build_app
This commit is contained in:
parent
8c7631b88d
commit
927c8d7285
@ -0,0 +1,543 @@
|
||||
<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>
|
||||
|
||||
|
||||
<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]="'district'"> <ng-container *clrDgHideableColumn="{hidden: false}"> district
|
||||
</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>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.countryidentifier}}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.state }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.district }}</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 class="clr-col-sm-12">
|
||||
<label>country</label>
|
||||
<select name="country" [(ngModel)]="rowSelected.country">
|
||||
<option [value]="null">Choose country</option>
|
||||
<option *ngFor=" let item of selectcountry" [value]="item.name">{{item.name }}</option> </select> </div>
|
||||
|
||||
|
||||
|
||||
<!-- dependent dropdown field start -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> state Dependent</label>
|
||||
<select name=" state" [(ngModel)]="rowSelected.state" class="clr-dropdown">
|
||||
<option [ngValue]="null">Select Option</option>
|
||||
<option *ngFor="let entity of statedependentData" [value]="entity.state_name">{{entity.state_name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- dependent dropdown field end -->
|
||||
|
||||
<!-- dependent dropdown field start -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> district Dependent</label>
|
||||
<select name=" district" [(ngModel)]="rowSelected.district" class="clr-dropdown">
|
||||
<option [ngValue]="null">Select Option</option>
|
||||
<option *ngFor="let entity of districtdependentData" [value]="entity.district_name">{{entity.district_name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- dependent dropdown field end -->
|
||||
|
||||
</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 -->
|
||||
|
||||
<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 class="clr-col-sm-12">
|
||||
<label> country</label>
|
||||
<select formControlName="country">
|
||||
<option [value]="null">Choose country</option>
|
||||
<option *ngFor="let item of selectcountry" [value]="item.name">{{item.name}}</option>
|
||||
</select> </div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- order form start -->
|
||||
<div *ngIf="iscountryorder" class="clr-col-sm-12" style="margin-bottom: 10px;">
|
||||
<button type="button" class="btn btn-primary" (click)="addcountryOrder()">
|
||||
+ Add to Order
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Order Summary Table -->
|
||||
<div class="clr-col-sm-12" *ngIf="countrySummary.length > 0">
|
||||
<h4>Order Summary</h4>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Line</th>
|
||||
|
||||
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of countrySummary; let i = index">
|
||||
|
||||
<td>{{ item.line }}</td>
|
||||
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger btn-sm" (click)="removecountryOrder(i)">
|
||||
🗑
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="max-width: 350px; float: right; margin-top: 18px;">
|
||||
<table style="width: 100%; font-size: 16px;">
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 500; color: #333;">Subtotal:</td>
|
||||
<td style="text-align: right; font-weight: 600; color: #222; width: 120px;">₹ {{ getcountrySubtotal() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 500; color: #333;">GST (18%):</td>
|
||||
<td style="text-align: right; font-weight: 600; color: #007bff;">₹ {{ getcountryGST() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><hr style="margin: 8px 0;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-size: 18px; font-weight: 700; color: #1a237e;">Total:</td>
|
||||
<td style="text-align: right; font-size: 20px; font-weight: 700; color: #1a237e;">₹ {{ getcountryGrandTotal() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- order form end -->
|
||||
|
||||
|
||||
<!-- dependent dropdown field start -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> state</label> <select formControlName="state" class="clr-dropdown">
|
||||
<option [ngValue]="null">Select Option</option>
|
||||
<option *ngFor="let entity of statedependentData" [value]="entity.state_name">{{ entity.state_name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- dependent dropdown field end -->
|
||||
|
||||
<!-- dependent dropdown field start -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> district</label> <select formControlName="district" class="clr-dropdown">
|
||||
<option [ngValue]="null">Select Option</option>
|
||||
<option *ngFor="let entity of districtdependentData" [value]="entity.district_name">{{ entity.district_name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- dependent dropdown field end -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- form code start -->
|
||||
<div *ngIf="checkFormCode">
|
||||
<h4 style="font-weight: 300;display: inline;">Extension</h4>
|
||||
<br>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
|
||||
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
|
||||
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
|
||||
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
|
||||
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
|
||||
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-checkbox" />
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- form code end --> <div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</clr-modal>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- htmlpopup -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,492 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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],
|
||||
|
||||
country : [null],
|
||||
|
||||
state : [null],
|
||||
|
||||
|
||||
district : [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
|
||||
|
||||
|
||||
|
||||
|
||||
this.getallcountry();
|
||||
|
||||
|
||||
|
||||
if (this.countrydefault) {
|
||||
// Listen for product changes to auto-fill description
|
||||
|
||||
|
||||
|
||||
this.entryForm.get('country')?.valueChanges.subscribe(name => {
|
||||
if (name && this.selectcountry) {
|
||||
|
||||
const found = this.selectcountry.find(p => p.name === name);
|
||||
|
||||
|
||||
|
||||
console.log('found is ', found);
|
||||
|
||||
// Auto-fill price when product is selected
|
||||
if (found && found.default_field) {
|
||||
this.entryForm.patchValue({ default_field: found.default_field_link });
|
||||
} else {
|
||||
this.entryForm.patchValue({ default_field: null });
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Listen for country changes
|
||||
|
||||
|
||||
this.entryForm.get('country')?.valueChanges.subscribe((item) => {
|
||||
|
||||
|
||||
if (item) {
|
||||
this.dependet2state(item);
|
||||
} else {
|
||||
this.statedependentData = [];
|
||||
this.entryForm.get('state')?.setValue(null); // clear state
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Listen for country changes
|
||||
|
||||
|
||||
this.entryForm.get('state')?.valueChanges.subscribe((item) => {
|
||||
|
||||
|
||||
if (item) {
|
||||
this.dependet2district(item);
|
||||
} else {
|
||||
this.districtdependentData = [];
|
||||
this.entryForm.get('district')?.setValue(null); // clear state
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Dependemt Dropdown field start
|
||||
this.dependet2state(row.dependentDD);
|
||||
// Dependemt Dropdown field end
|
||||
|
||||
// Dependemt Dropdown field start
|
||||
this.dependet2district(row.dependentDD);
|
||||
// Dependemt Dropdown 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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
countrydefault=false
|
||||
selectcountry ;
|
||||
getallcountry() {
|
||||
this.mainService.getAllcountry().subscribe(data=>{
|
||||
this.selectcountry = data;
|
||||
console.log(data);
|
||||
},(error) => { console.log(error); }); }
|
||||
|
||||
|
||||
|
||||
// ================== ORDER SUMMARY LOGIC START ==================
|
||||
/**
|
||||
* Order Summary Array and Methods for Add to Order functionality
|
||||
*/
|
||||
countrySummary: any[] = [];
|
||||
countrytotal;
|
||||
iscountryorder =false;
|
||||
/**
|
||||
* Add selected product to order summary
|
||||
*/
|
||||
addcountryOrder() {
|
||||
const formValue = this.entryForm.value;
|
||||
if (!formValue.country ) {
|
||||
this.toastr.error('Please select country');
|
||||
return;
|
||||
}
|
||||
// Get description from master (selectcountry)
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.selectcountry && Array.isArray(this.selectcountry)) {
|
||||
|
||||
|
||||
const found = this.selectcountry.find(p => p.name === formValue.country);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
const line = this.countrySummary.length + 1;
|
||||
const orderItem = {
|
||||
line: line,
|
||||
|
||||
// unitPrice: Number(formValue.price),
|
||||
// quantity: Number(formValue.quantity),
|
||||
// total: Number(formValue.price) * Number(formValue.quantity)
|
||||
};
|
||||
this.countrySummary.push(orderItem);
|
||||
|
||||
this.countrytotal = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove item from order summary by index
|
||||
*/
|
||||
removecountryOrder(index: number) {
|
||||
this.countrySummary.splice(index, 1);
|
||||
// Recalculate line numbers
|
||||
this.countrySummary.forEach((item, i) => {
|
||||
item.line = i + 1;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate subtotal of all order items
|
||||
*/
|
||||
getcountrySubtotal(): number {
|
||||
return this.countrySummary.reduce((sum, item) => sum + item.total, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate GST (18%)
|
||||
*/
|
||||
getcountryGST(): number {
|
||||
return this.getcountrySubtotal() * 0.18;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate grand total (subtotal + GST)
|
||||
*/
|
||||
getcountryGrandTotal(): number {
|
||||
return this.getcountrySubtotal() + this.getcountryGST();
|
||||
|
||||
}
|
||||
// ================== ORDER SUMMARY LOGIC END ==================
|
||||
|
||||
|
||||
// Dependemt Dropdown field start
|
||||
|
||||
|
||||
statedependentData: any;
|
||||
dependet2state (item){
|
||||
this.mainService.getstateDependent(item).subscribe( (data) => {
|
||||
console.log(data);
|
||||
this.statedependentData = data;
|
||||
},(error) => { console.log(error); });
|
||||
}
|
||||
|
||||
|
||||
// DependemtDropdown field end
|
||||
|
||||
// Dependemt Dropdown field start
|
||||
|
||||
|
||||
districtdependentData: any;
|
||||
dependet2district (item){
|
||||
this.mainService.getdistrictDependent(item).subscribe( (data) => {
|
||||
console.log(data);
|
||||
this.districtdependentData = data;
|
||||
},(error) => { console.log(error); });
|
||||
}
|
||||
|
||||
|
||||
// DependemtDropdown field end
|
||||
|
||||
// updateaction
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
getAllcountry(): Observable<any> {
|
||||
return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
|
||||
|
||||
getstateDependent(field: string): Observable<any> {
|
||||
return this.apiRequest.get("State_ListFilter1/State_ListFilter11/" + field);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getdistrictDependent(field: string): Observable<any> {
|
||||
return this.apiRequest.get("District_ListFilter1/District_ListFilter11/" + field);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Ad6cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,453 @@
|
||||
<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 -->
|
||||
|
||||
<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" 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" 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="toggle_switch2">Toggle_Switch2:</label>
|
||||
<input type="text" id="toggle_switch2" formControlName="toggle_switch2" name="toggle_switch2" placeholder="Enter Toggle_Switch2" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="decimal_field2">Decimal_Field2:</label>
|
||||
<input type="text" id="decimal_field2" formControlName="decimal_field2" name="decimal_field2" placeholder="Enter Decimal_Field2" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="documentsequenc">Documentsequenc:</label>
|
||||
<input type="text" id="documentsequenc" formControlName="documentsequenc" name="documentsequenc" placeholder="Enter Documentsequenc" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="toggle_switch">Toggle_Switch:</label>
|
||||
<input type="text" id="toggle_switch" formControlName="toggle_switch" name="toggle_switch" placeholder="Enter Toggle_Switch" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="recaptcha">Recaptcha:</label>
|
||||
<input type="text" id="recaptcha" formControlName="recaptcha" name="recaptcha" placeholder="Enter Recaptcha" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="percentage_field">Percentage_Field:</label>
|
||||
<input type="text" id="percentage_field" formControlName="percentage_field" name="percentage_field" placeholder="Enter Percentage_Field" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="percentage_field2">Percentage_Field2:</label>
|
||||
<input type="text" id="percentage_field2" formControlName="percentage_field2" name="percentage_field2" placeholder="Enter Percentage_Field2" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="url_field">Url_Field:</label>
|
||||
<input type="text" id="url_field" formControlName="url_field" name="url_field" placeholder="Enter Url_Field" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="url_field2">Url_Field2:</label>
|
||||
<input type="text" id="url_field2" formControlName="url_field2" name="url_field2" placeholder="Enter Url_Field2" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="decimal_field">Decimal_Field:</label>
|
||||
<input type="text" id="decimal_field" formControlName="decimal_field" name="decimal_field" placeholder="Enter Decimal_Field" class="clr-input">
|
||||
</div>
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="recaptcha2">Recaptcha2:</label>
|
||||
<input type="text" id="recaptcha2" formControlName="recaptcha2" name="recaptcha2" placeholder="Enter Recaptcha2" 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>
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,387 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
toggle_switch2: 'toggle_switch',
|
||||
decimal_field2: 'decimal',
|
||||
documentsequenc: 'document_sequence',
|
||||
toggle_switch: 'toggle_switch',
|
||||
recaptcha: 'recaptcha',
|
||||
percentage_field: 'number',
|
||||
percentage_field2: 'number',
|
||||
url_field: 'url',
|
||||
url_field2: 'url',
|
||||
decimal_field: 'decimal',
|
||||
recaptcha2: 'recaptcha',
|
||||
});
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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_FieldBasicp3(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
|
||||
|
||||
|
||||
}
|
||||
@ -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 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_FieldBasicp3(Basicp3: any): Observable<any> {
|
||||
return this.apiRequest.post(`Ad7/Ad7/Basicp3_insert`, Basicp3);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Ad7cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,619 @@
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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.name }}</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 Ad8
|
||||
<!--update button -->
|
||||
<!-- update button -->
|
||||
<button id="Update" class="btn btn-primary" (click)="goToUpdateButtonupdate2()">
|
||||
<clr-icon shape="plus"></clr-icon>Update Buttonupdate2
|
||||
</button>
|
||||
<!-- update end -->
|
||||
|
||||
<!-- 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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<!-- 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;">active</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:200px;">description</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:200px;">name</th>
|
||||
|
||||
|
||||
<th class="right" style="width:200px;">{{ childformcomponents?.length >= 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let component of childformcomponents; let i = index">
|
||||
|
||||
|
||||
|
||||
<td class="left"> <input type="text" name="active" [(ngModel)]="component.active" [ngModelOptions]=" {standalone: true}" placeholder="Enter active" class="clr-input">
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<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)="oneditchildform()" 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 -->
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<!-- one to many code start here -->
|
||||
<div style="margin-top: 30px;"><h4 style="display: inline;">childform </h4>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-lg-12">
|
||||
<table class="table" style="width:100%;" formArrayName="childform">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">active</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">description</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">name</th>
|
||||
|
||||
|
||||
|
||||
<th class="right" style="width:125px;">{{ childformcontrols.length > 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of childformcontrols; let i=index" [formGroupName]="i">
|
||||
|
||||
|
||||
<td class="left"> <input type="text" formControlName="active" placeholder="Enter active" style="width:180px"
|
||||
class="clr-input"> </td>
|
||||
|
||||
|
||||
|
||||
<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="childformcontrols.length > 1" (click)="onRemovechildform(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<button type="button" class="btn btn-primary button1" (click)="onAddchildform()" >
|
||||
<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)]="modalUpdateButtonupdate2" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
<h3 class="modal-title">Update Buttonupdate2</h3>
|
||||
<div class="modal-body">
|
||||
<form [formGroup]="UpdateFormButtonupdate2" (ngSubmit)="onSubmitUpdateButtonupdate2(rowSelected.id)">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label for="active">Active:</label>
|
||||
<input type="text" id="active" formControlName="active" name="active" placeholder="Enter Active" class="clr-input">
|
||||
</div>
|
||||
<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" placeholder="Enter Name" class="clr-input">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="modalUpdateButtonupdate2 = false">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" >Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</clr-modal>
|
||||
|
||||
|
||||
|
||||
<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" placeholder="Enter Name" 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>
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,478 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// component button
|
||||
public UpdateFormButtonupdate2: FormGroup;
|
||||
|
||||
|
||||
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.supportinitLinesForm(),
|
||||
|
||||
childform: this._fb.array([this.initchildformForm()]),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // component_button200
|
||||
// inser code start
|
||||
this.UpdateFormButtonupdate2 = this._fb.group({
|
||||
active: '',
|
||||
description: '',
|
||||
name: '',
|
||||
});
|
||||
|
||||
// Update code end
|
||||
|
||||
// inser code start
|
||||
this.UpdateFormButtonUpdate = this._fb.group({
|
||||
description: '',
|
||||
name: '',
|
||||
});
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
supportinitLinesForm() { return this._fb.group({
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
|
||||
|
||||
// one to many start
|
||||
initchildformForm() { return this._fb.group({
|
||||
|
||||
|
||||
|
||||
active: [null],
|
||||
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
get childformcontrols() {return (this.entryForm.get("childform") as FormArray).controls; }
|
||||
onAddchildform() {
|
||||
(<FormArray>this.entryForm.get("childform")).push(this.initchildformForm()); }
|
||||
onRemovechildform(index: number) {
|
||||
(<FormArray>this.entryForm.get("childform")).removeAt(index); }
|
||||
oneditchildform() { this.childformcomponents.push({
|
||||
|
||||
|
||||
active: "",
|
||||
|
||||
|
||||
|
||||
description: "",
|
||||
|
||||
|
||||
|
||||
name: "",
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
deletechildformRow(index) {
|
||||
this.childformcomponents.splice(index, 1);
|
||||
}
|
||||
childformcomponents;
|
||||
// one to many end
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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.childformcomponents = row.childform;
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
modalUpdateButtonupdate2 = false;
|
||||
goToUpdateButtonupdate2() {
|
||||
this.modalUpdateButtonupdate2=true;
|
||||
}
|
||||
onSubmitUpdateButtonupdate2(id) {
|
||||
console.log(this.UpdateFormButtonupdate2.value);
|
||||
this.submitted=true;
|
||||
if (this.UpdateFormButtonupdate2.invalid) {
|
||||
return;
|
||||
}
|
||||
this.onUpdateButtonupdate2(id);
|
||||
}
|
||||
onUpdateButtonupdate2(id) {
|
||||
this.modalUpdateButtonupdate2=false;
|
||||
this.mainService.updateChildform(id,this.UpdateFormButtonupdate2.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.UpdateFormButtonupdate2.reset();
|
||||
}
|
||||
// update buuton code end
|
||||
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
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
|
||||
updateChildform(id: number,Childform: any): Observable<any> {
|
||||
return this.apiRequest.put(`Childform/Childform_update/`+ id, Childform);
|
||||
}
|
||||
|
||||
// update button code start
|
||||
updateSupport(id: number,Support: any): Observable<any> {
|
||||
return this.apiRequest.put(`Support/Support_update/`+ id, Support);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Ad8cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -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 -->
|
||||
|
||||
<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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,282 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
approved_field_tablename = 'Ad9'
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Ad9cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,957 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Adv1service} from './Adv1.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 { Adv1cardvariable } from './Adv1_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Adv1',
|
||||
templateUrl: './Adv1.component.html',
|
||||
styleUrls: ['./Adv1.component.scss']
|
||||
})
|
||||
export class Adv1Component implements OnInit {
|
||||
cardButton = Adv1cardvariable.cardButton;
|
||||
cardmodeldata = Adv1cardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Adv1cardvariable.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 = 'Adv1_formCode'
|
||||
tableName = 'Adv1'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Adv1service,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
ismale : [null],
|
||||
|
||||
idfemale : [null],
|
||||
|
||||
|
||||
|
||||
test1:[false],
|
||||
|
||||
|
||||
|
||||
test2:[false],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
t1:[false],
|
||||
|
||||
|
||||
|
||||
t2:[false],
|
||||
|
||||
|
||||
|
||||
t4:[false],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // 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 === "Adv1_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FileDataImageupload_field: any[];
|
||||
selectedImageupload_field: any[];
|
||||
|
||||
FileDataImageupload_field2: any[];
|
||||
selectedImageupload_field2: any[];
|
||||
|
||||
FileDataAudio_field: any[];
|
||||
selectedAudio_field: any[];
|
||||
|
||||
FileDataAudio_field2: any[];
|
||||
selectedAudio_field2: any[];
|
||||
|
||||
FileDataVideo_field: any[];
|
||||
selectedVideo_field: any[];
|
||||
|
||||
|
||||
FileDataVideo_field2: any[];
|
||||
selectedVideo_field2: any[];
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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.selectedfileupload_field = [];
|
||||
this.mainService.uploadfilegetByIdfileupload_field(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDatafileupload_field = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedfileupload_field2 = [];
|
||||
this.mainService.uploadfilegetByIdfileupload_field2(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDatafileupload_field2 = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedimageupload_field = [];
|
||||
this.mainService.uploadImageupload_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDataimageupload_field = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedimageupload_field2 = [];
|
||||
this.mainService.uploadImageupload_field2getById(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDataimageupload_field2 = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedaudio_field = [];
|
||||
this.mainService.uploadAudio_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDataaudio_field = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedaudio_field2 = [];
|
||||
this.mainService.uploadAudio_field2getById(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDataaudio_field2 = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedvideo_field = [];
|
||||
this.mainService.uploadVideo_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDatavideo_field = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
this.selectedvideo_field2 = [];
|
||||
this.mainService.uploadVideo_field2getById(row.id,this.tableName).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
this.FileDatavideo_field2 = uploaddata;
|
||||
|
||||
})
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (let i = 0; i < this.selectedfileupload_field.length; i++){
|
||||
|
||||
this.mainService.uploadfilefileupload_field(data.id,this.tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedfileupload_field2.length; i++){
|
||||
|
||||
this.mainService.uploadfilefileupload_field2(data.id,this.tableName,this.selectedfileupload_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedimageupload_field.length; i++){
|
||||
|
||||
this.mainService.uploadImageupload_field(data.id,this.tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedimageupload_field2.length; i++){
|
||||
|
||||
this.mainService.uploadImageupload_field2(data.id,this.tableName,this.selectedimageupload_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedaudio_field.length; i++){
|
||||
|
||||
this.mainService.uploadAudio_field(data.id,this.tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedaudio_field2.length; i++){
|
||||
|
||||
this.mainService.uploadAudio_field2(data.id,this.tableName,this.selectedaudio_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedvideo_field.length; i++){
|
||||
|
||||
this.mainService.uploadVideo_field(data.id,this.tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedvideo_field2.length; i++){
|
||||
|
||||
this.mainService.uploadVideo_field2(data.id,this.tableName,this.selectedvideo_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
}, (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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (let i = 0; i < this.selectedfileupload_field.length; i++){
|
||||
|
||||
this.mainService.uploadfilefileupload_field(data.id,this.tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedfileupload_field2.length; i++){
|
||||
|
||||
this.mainService.uploadfilefileupload_field2(data.id,this.tableName,this.selectedfileupload_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedimageupload_field.length; i++){
|
||||
|
||||
this.mainService.uploadImageupload_field(data.id,this.tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedimageupload_field2.length; i++){
|
||||
|
||||
this.mainService.uploadImageupload_field2(data.id,this.tableName,this.selectedimageupload_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedaudio_field.length; i++){
|
||||
|
||||
this.mainService.uploadAudio_field(data.id,this.tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedaudio_field2.length; i++){
|
||||
|
||||
this.mainService.uploadAudio_field2(data.id,this.tableName,this.selectedaudio_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedvideo_field.length; i++){
|
||||
|
||||
this.mainService.uploadVideo_field(data.id,this.tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.selectedvideo_field2.length; i++){
|
||||
|
||||
this.mainService.uploadVideo_field2(data.id,this.tableName,this.selectedvideo_field2[i]).subscribe(uploaddata =>{
|
||||
console.log(uploaddata);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}, (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.FileDatafileupload_field = [];
|
||||
this.selectedfileupload_field =[];
|
||||
|
||||
this.FileDatafileupload_field2 = [];
|
||||
this.selectedfileupload_field2 =[];
|
||||
|
||||
this.FileDataImageupload_field = [];
|
||||
this.selectedImageupload_field =[];
|
||||
|
||||
this.FileDataImageupload_field2 = [];
|
||||
this.selectedImageupload_field2 =[];
|
||||
|
||||
this.FileDataAudio_field = [];
|
||||
this.selectedAudio_field =[];
|
||||
|
||||
this.FileDataAudio_field2 = [];
|
||||
this.selectedAudio_field2 =[];
|
||||
|
||||
this.FileDataVideo_field = [];
|
||||
this.selectedVideo_field =[];
|
||||
|
||||
this.FileDataVideo_field2 = [];
|
||||
this.selectedVideo_field2 =[];
|
||||
|
||||
|
||||
}
|
||||
submitted = false;
|
||||
onSubmit() {
|
||||
console.log(this.entryForm.value);
|
||||
this.submitted = true;
|
||||
if (this.entryForm.invalid) {
|
||||
return;
|
||||
}this.onCreate();
|
||||
|
||||
}
|
||||
updateismale (ismale : string): void {
|
||||
this.entryForm.get('ismale').setValue(ismale); }
|
||||
|
||||
updateismaleEdit(ismale : string): void { this.rowSelected.ismale = ismale }
|
||||
;
|
||||
|
||||
updateidfemale (idfemale : string): void {
|
||||
this.entryForm.get('idfemale').setValue(idfemale); }
|
||||
|
||||
updateidfemaleEdit(idfemale : string): void { this.rowSelected.idfemale = idfemale }
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
filePreviewfileupload_field: string | ArrayBuffer | null = null;
|
||||
FileDatafileupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedfileupload_field: File[]=[];
|
||||
public onFileChangedfileupload_field(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDatafileupload_field[index].uploadedfile_name = files[i].name;
|
||||
this.selectedfileupload_field.push(files[i]);
|
||||
if (file.type.startsWith('file/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDatafileupload_field[index] = {
|
||||
...this.FileDatafileupload_field[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesfileupload_field(){
|
||||
this.FileDatafileupload_field.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowfileupload_field(index,id) {
|
||||
this.FileDatafileupload_field.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadfiledeletefileupload_field(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewfileupload_field2: string | ArrayBuffer | null = null;
|
||||
FileDatafileupload_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedfileupload_field2: File[]=[];
|
||||
public onFileChangedfileupload_field2(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDatafileupload_field2[index].uploadedfile_name = files[i].name;
|
||||
this.selectedfileupload_field2.push(files[i]);
|
||||
if (file.type.startsWith('file/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDatafileupload_field2[index] = {
|
||||
...this.FileDatafileupload_field2[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesfileupload_field2(){
|
||||
this.FileDatafileupload_field2.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowfileupload_field2(index,id) {
|
||||
this.FileDatafileupload_field2.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadfiledeletefileupload_field2(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewimageupload_field: string | ArrayBuffer | null = null;
|
||||
FileDataimageupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedimageupload_field: File[]=[];
|
||||
public onFileChangedimageupload_field(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDataimageupload_field[index].uploadedfile_name = files[i].name;
|
||||
this.selectedimageupload_field.push(files[i]);
|
||||
if (file.type.startsWith('image/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDataimageupload_field[index] = {
|
||||
...this.FileDataimageupload_field[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesimageupload_field(){
|
||||
this.FileDataimageupload_field.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowimageupload_field(index,id) {
|
||||
this.FileDataimageupload_field.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadImageupload_fielddelete(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewimageupload_field2: string | ArrayBuffer | null = null;
|
||||
FileDataimageupload_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedimageupload_field2: File[]=[];
|
||||
public onFileChangedimageupload_field2(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDataimageupload_field2[index].uploadedfile_name = files[i].name;
|
||||
this.selectedimageupload_field2.push(files[i]);
|
||||
if (file.type.startsWith('image/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDataimageupload_field2[index] = {
|
||||
...this.FileDataimageupload_field2[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesimageupload_field2(){
|
||||
this.FileDataimageupload_field2.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowimageupload_field2(index,id) {
|
||||
this.FileDataimageupload_field2.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadImageupload_field2delete(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewaudio_field: string | ArrayBuffer | null = null;
|
||||
FileDataaudio_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedaudio_field: File[]=[];
|
||||
public onFileChangedaudio_field(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDataaudio_field[index].uploadedfile_name = files[i].name;
|
||||
this.selectedaudio_field.push(files[i]);
|
||||
if (file.type.startsWith('audio/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDataaudio_field[index] = {
|
||||
...this.FileDataaudio_field[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesaudio_field(){
|
||||
this.FileDataaudio_field.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowaudio_field(index,id) {
|
||||
this.FileDataaudio_field.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadAudio_fielddelete(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewaudio_field2: string | ArrayBuffer | null = null;
|
||||
FileDataaudio_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedaudio_field2: File[]=[];
|
||||
public onFileChangedaudio_field2(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDataaudio_field2[index].uploadedfile_name = files[i].name;
|
||||
this.selectedaudio_field2.push(files[i]);
|
||||
if (file.type.startsWith('audio/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDataaudio_field2[index] = {
|
||||
...this.FileDataaudio_field2[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesaudio_field2(){
|
||||
this.FileDataaudio_field2.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowaudio_field2(index,id) {
|
||||
this.FileDataaudio_field2.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadAudio_field2delete(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewvideo_field: string | ArrayBuffer | null = null;
|
||||
FileDatavideo_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedvideo_field: File[]=[];
|
||||
public onFileChangedvideo_field(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDatavideo_field[index].uploadedfile_name = files[i].name;
|
||||
this.selectedvideo_field.push(files[i]);
|
||||
if (file.type.startsWith('video/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDatavideo_field[index] = {
|
||||
...this.FileDatavideo_field[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesvideo_field(){
|
||||
this.FileDatavideo_field.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowvideo_field(index,id) {
|
||||
this.FileDatavideo_field.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadVideo_fielddelete(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
filePreviewvideo_field2: string | ArrayBuffer | null = null;
|
||||
FileDatavideo_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
|
||||
selectedvideo_field2: File[]=[];
|
||||
public onFileChangedvideo_field2(event, index) {
|
||||
const files = event.target.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
this.FileDatavideo_field2[index].uploadedfile_name = files[i].name;
|
||||
this.selectedvideo_field2.push(files[i]);
|
||||
if (file.type.startsWith('video/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
// Set the file preview source
|
||||
const filePreview = e.target?.result as string;
|
||||
this.FileDatavideo_field2[index] = {
|
||||
...this.FileDatavideo_field2[index], // Preserve existing properties
|
||||
filePreview: filePreview // Update only the filePreview property
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
onAddLinesvideo_field2(){
|
||||
this.FileDatavideo_field2.push({
|
||||
uploadedfile_name: "",
|
||||
filePreview: "",
|
||||
// f3: "",
|
||||
});
|
||||
}
|
||||
deleteRowvideo_field2(index,id) {
|
||||
this.FileDatavideo_field2.splice(index, 1);
|
||||
|
||||
if(id){
|
||||
this.mainService.uploadVideo_field2delete(id).subscribe(data =>{
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// updateaction
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,161 @@
|
||||
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 Adv1service{
|
||||
private baseURL = "Adv1/Adv1" ; 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uploadfilefileupload_field(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadfilegetByIdfileupload_field(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadfiledeletefileupload_field(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadfilefileupload_field2(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadfilegetByIdfileupload_field2(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadfiledeletefileupload_field2(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadImageupload_field(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadImageupload_fieldgetById(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadImageupload_fielddelete(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadImageupload_field2(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadImageupload_field2getById(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadImageupload_field2delete(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadAudio_field(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadAudio_fieldgetById(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadAudio_fielddelete(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadAudio_field2(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadAudio_field2getById(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadAudio_field2delete(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadVideo_field(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadVideo_fieldgetById(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadVideo_fielddelete(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
uploadVideo_field2(ref:any, Adv1:any, file:any): Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
|
||||
}
|
||||
|
||||
uploadVideo_field2getById(ref:any, Adv1:any,): Observable<any> {
|
||||
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
|
||||
}
|
||||
|
||||
|
||||
uploadVideo_field2delete(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
|
||||
}
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Adv1cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,898 @@
|
||||
<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.dy2identifier}}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.dy1identifier}}</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>
|
||||
|
||||
|
||||
|
||||
|
||||
<option> bhutan </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>
|
||||
|
||||
|
||||
|
||||
|
||||
<option> test </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.description }}</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.description">{{item.description}} </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 -->
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<option> bhutan </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>
|
||||
|
||||
|
||||
|
||||
<option> test </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>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- order form start -->
|
||||
<div *ngIf="isdy2order" class="clr-col-sm-12" style="margin-bottom: 10px;">
|
||||
<button type="button" class="btn btn-primary" (click)="adddy2Order()">
|
||||
+ Add to Order
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Order Summary Table -->
|
||||
<div class="clr-col-sm-12" *ngIf="dy2Summary.length > 0">
|
||||
<h4>Order Summary</h4>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Line</th>
|
||||
|
||||
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of dy2Summary; let i = index">
|
||||
|
||||
<td>{{ item.line }}</td>
|
||||
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger btn-sm" (click)="removedy2Order(i)">
|
||||
🗑
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="max-width: 350px; float: right; margin-top: 18px;">
|
||||
<table style="width: 100%; font-size: 16px;">
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 500; color: #333;">Subtotal:</td>
|
||||
<td style="text-align: right; font-weight: 600; color: #222; width: 120px;">₹ {{ getdy2Subtotal() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 500; color: #333;">GST (18%):</td>
|
||||
<td style="text-align: right; font-weight: 600; color: #007bff;">₹ {{ getdy2GST() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><hr style="margin: 8px 0;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-size: 18px; font-weight: 700; color: #1a237e;">Total:</td>
|
||||
<td style="text-align: right; font-size: 20px; font-weight: 700; color: #1a237e;">₹ {{ getdy2GrandTotal() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- order form end -->
|
||||
|
||||
|
||||
|
||||
|
||||
<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.description}}</option>
|
||||
</select> </div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- order form start -->
|
||||
<div *ngIf="isdy1order" class="clr-col-sm-12" style="margin-bottom: 10px;">
|
||||
<button type="button" class="btn btn-primary" (click)="adddy1Order()">
|
||||
+ Add to Order
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Order Summary Table -->
|
||||
<div class="clr-col-sm-12" *ngIf="dy1Summary.length > 0">
|
||||
<h4>Order Summary</h4>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Line</th>
|
||||
|
||||
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of dy1Summary; let i = index">
|
||||
|
||||
<td>{{ item.line }}</td>
|
||||
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger btn-sm" (click)="removedy1Order(i)">
|
||||
🗑
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="max-width: 350px; float: right; margin-top: 18px;">
|
||||
<table style="width: 100%; font-size: 16px;">
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 500; color: #333;">Subtotal:</td>
|
||||
<td style="text-align: right; font-weight: 600; color: #222; width: 120px;">₹ {{ getdy1Subtotal() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 500; color: #333;">GST (18%):</td>
|
||||
<td style="text-align: right; font-weight: 600; color: #007bff;">₹ {{ getdy1GST() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><hr style="margin: 8px 0;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-size: 18px; font-weight: 700; color: #1a237e;">Total:</td>
|
||||
<td style="text-align: right; font-size: 20px; font-weight: 700; color: #1a237e;">₹ {{ getdy1GrandTotal() | number:'1.4-4' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- order form end -->
|
||||
|
||||
|
||||
|
||||
|
||||
<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. description"> {{item. description}}</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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,777 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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();
|
||||
|
||||
|
||||
|
||||
if (this.dy2default) {
|
||||
// Listen for product changes to auto-fill description
|
||||
|
||||
|
||||
|
||||
this.entryForm.get('dy2')?.valueChanges.subscribe(name => {
|
||||
if (name && this.selectdy2) {
|
||||
|
||||
const found = this.selectdy2.find(p => p.name === name);
|
||||
|
||||
|
||||
|
||||
console.log('found is ', found);
|
||||
|
||||
// Auto-fill price when product is selected
|
||||
if (found && found.default_field) {
|
||||
this.entryForm.patchValue({ default_field: found.default_field_link });
|
||||
} else {
|
||||
this.entryForm.patchValue({ default_field: null });
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.getalldy1();
|
||||
|
||||
|
||||
|
||||
if (this.dy1default) {
|
||||
// Listen for product changes to auto-fill description
|
||||
|
||||
|
||||
|
||||
this.entryForm.get('dy1')?.valueChanges.subscribe(description => {
|
||||
if (description && this.selectdy1) {
|
||||
|
||||
const found = this.selectdy1.find(p => p.description === description);
|
||||
|
||||
|
||||
|
||||
console.log('found is ', found);
|
||||
|
||||
// Auto-fill price when product is selected
|
||||
if (found && found.default_field) {
|
||||
this.entryForm.patchValue({ default_field: found.default_field_link });
|
||||
} else {
|
||||
this.entryForm.patchValue({ default_field: null });
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.getalldymlti1();
|
||||
|
||||
this.getalldymlt2();
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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',
|
||||
|
||||
|
||||
];
|
||||
|
||||
dy2default=false
|
||||
selectdy2 ;
|
||||
getalldy2() {
|
||||
this.mainService.getAlldy2().subscribe(data=>{
|
||||
this.selectdy2 = data;
|
||||
console.log(data);
|
||||
},(error) => { console.log(error); }); }
|
||||
|
||||
|
||||
|
||||
// ================== ORDER SUMMARY LOGIC START ==================
|
||||
/**
|
||||
* Order Summary Array and Methods for Add to Order functionality
|
||||
*/
|
||||
dy2Summary: any[] = [];
|
||||
dy2total;
|
||||
isdy2order =false;
|
||||
/**
|
||||
* Add selected product to order summary
|
||||
*/
|
||||
adddy2Order() {
|
||||
const formValue = this.entryForm.value;
|
||||
if (!formValue.dy2 ) {
|
||||
this.toastr.error('Please select dy2');
|
||||
return;
|
||||
}
|
||||
// Get description from master (selectdy2)
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.selectdy2 && Array.isArray(this.selectdy2)) {
|
||||
|
||||
|
||||
const found = this.selectdy2.find(p => p.name === formValue.dy2);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
const line = this.dy2Summary.length + 1;
|
||||
const orderItem = {
|
||||
line: line,
|
||||
|
||||
// unitPrice: Number(formValue.price),
|
||||
// quantity: Number(formValue.quantity),
|
||||
// total: Number(formValue.price) * Number(formValue.quantity)
|
||||
};
|
||||
this.dy2Summary.push(orderItem);
|
||||
|
||||
this.dy2total = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove item from order summary by index
|
||||
*/
|
||||
removedy2Order(index: number) {
|
||||
this.dy2Summary.splice(index, 1);
|
||||
// Recalculate line numbers
|
||||
this.dy2Summary.forEach((item, i) => {
|
||||
item.line = i + 1;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate subtotal of all order items
|
||||
*/
|
||||
getdy2Subtotal(): number {
|
||||
return this.dy2Summary.reduce((sum, item) => sum + item.total, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate GST (18%)
|
||||
*/
|
||||
getdy2GST(): number {
|
||||
return this.getdy2Subtotal() * 0.18;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate grand total (subtotal + GST)
|
||||
*/
|
||||
getdy2GrandTotal(): number {
|
||||
return this.getdy2Subtotal() + this.getdy2GST();
|
||||
|
||||
}
|
||||
// ================== ORDER SUMMARY LOGIC END ==================
|
||||
|
||||
|
||||
dy1default=false
|
||||
selectdy1 ;
|
||||
getalldy1() {
|
||||
this.mainService.getAlldy1().subscribe(data=>{
|
||||
this.selectdy1 = data;
|
||||
console.log(data);
|
||||
},(error) => { console.log(error); }); }
|
||||
|
||||
|
||||
|
||||
// ================== ORDER SUMMARY LOGIC START ==================
|
||||
/**
|
||||
* Order Summary Array and Methods for Add to Order functionality
|
||||
*/
|
||||
dy1Summary: any[] = [];
|
||||
dy1total;
|
||||
isdy1order =false;
|
||||
/**
|
||||
* Add selected product to order summary
|
||||
*/
|
||||
adddy1Order() {
|
||||
const formValue = this.entryForm.value;
|
||||
if (!formValue.dy1 ) {
|
||||
this.toastr.error('Please select dy1');
|
||||
return;
|
||||
}
|
||||
// Get description from master (selectdy1)
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.selectdy1 && Array.isArray(this.selectdy1)) {
|
||||
|
||||
|
||||
const found = this.selectdy1.find(p => p.description === formValue.dy1);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
const line = this.dy1Summary.length + 1;
|
||||
const orderItem = {
|
||||
line: line,
|
||||
|
||||
// unitPrice: Number(formValue.price),
|
||||
// quantity: Number(formValue.quantity),
|
||||
// total: Number(formValue.price) * Number(formValue.quantity)
|
||||
};
|
||||
this.dy1Summary.push(orderItem);
|
||||
|
||||
this.dy1total = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove item from order summary by index
|
||||
*/
|
||||
removedy1Order(index: number) {
|
||||
this.dy1Summary.splice(index, 1);
|
||||
// Recalculate line numbers
|
||||
this.dy1Summary.forEach((item, i) => {
|
||||
item.line = i + 1;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate subtotal of all order items
|
||||
*/
|
||||
getdy1Subtotal(): number {
|
||||
return this.dy1Summary.reduce((sum, item) => sum + item.total, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate GST (18%)
|
||||
*/
|
||||
getdy1GST(): number {
|
||||
return this.getdy1Subtotal() * 0.18;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate grand total (subtotal + GST)
|
||||
*/
|
||||
getdy1GrandTotal(): number {
|
||||
return this.getdy1Subtotal() + this.getdy1GST();
|
||||
|
||||
}
|
||||
// ================== ORDER SUMMARY LOGIC END ==================
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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("Country_ListFilter1/Country_ListFilter1");
|
||||
|
||||
}
|
||||
|
||||
getdatagrid_field2All(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getAlldy2(): Observable<any> {
|
||||
return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
getAlldy1(): Observable<any> {
|
||||
return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
getAlldymlti1(): Observable<any> { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
getAlldymlt2(): Observable<any> { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Adv3cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,623 @@
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'childform.active'"> <ng-container *clrDgHideableColumn="{hidden: false}">active</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'childform.description'"> <ng-container *clrDgHideableColumn="{hidden: false}">description</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'childform.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.atocidentifier}}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.atc2identifier}}</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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.childform?.active}}</clr-dg-cell>
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.childform?.description}}</clr-dg-cell>
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.childform?.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.description">{{item.description}} </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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-md-4 clr-col-sm-12"> <label>active</label>
|
||||
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.childform.active" name="active" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-md-4 clr-col-sm-12"> <label>description</label>
|
||||
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.childform.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.childform.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 -->
|
||||
|
||||
<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. description"> {{item. description}}</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>
|
||||
|
||||
|
||||
<div style="margin-top: 30px;">
|
||||
<h4 style="display: inline;">childform </h4> </div> <hr>
|
||||
<div class="clr-row" formArrayName="childform">
|
||||
|
||||
|
||||
<div class="clr-col-md-4 clr-col-sm-12">
|
||||
<label> active</label>
|
||||
<input class="clr-input" type="text" formControlName="active" /> </div>
|
||||
|
||||
|
||||
|
||||
<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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,395 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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.supportinitLinesForm(),
|
||||
|
||||
childform: this.childforminitLinesForm(),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // 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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
supportinitLinesForm() { return this._fb.group({
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
|
||||
|
||||
|
||||
childforminitLinesForm() { return this._fb.group({
|
||||
|
||||
|
||||
active: [null],
|
||||
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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 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("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
getAllatc2(): Observable<any> { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
getAllatdy1(): Observable<any> { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
getAllatdy2(): Observable<any> { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Adv4cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,787 @@
|
||||
<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>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>addition</label>
|
||||
<input class="clr-input" type="text" [value]="additiontotal" readonly />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>multiplication</label>
|
||||
<input class="clr-input" type="text" [value]="multiplicationtotal" readonly />
|
||||
</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;">{{ supportcomponents?.length >= 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let component of supportcomponents; 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)="oneditsupport()" style="margin-left: 20px;">
|
||||
<clr-icon shape="plus"></clr-icon> </button>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- one to many code end here -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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;">active</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:200px;">description</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:200px;">name</th>
|
||||
|
||||
|
||||
<th class="right" style="width:200px;">{{ childformcomponents?.length >= 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let component of childformcomponents; let i = index">
|
||||
|
||||
|
||||
|
||||
<td class="left"> <input type="text" name="active" [(ngModel)]="component.active" [ngModelOptions]=" {standalone: true}" placeholder="Enter active" class="clr-input">
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<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)="oneditchildform()" 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 -->
|
||||
|
||||
<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>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>addition</label>
|
||||
<input class="clr-input" type="text" [value]="additiontotal" readonly />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>multiplication</label>
|
||||
<input class="clr-input" type="text" [value]="multiplicationtotal" readonly />
|
||||
</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;">{{ supportcontrols.length > 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of supportcontrols; 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="supportcontrols.length > 1" (click)="onRemovesupport(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<button type="button" class="btn btn-primary button1" (click)="onAddsupport()" >
|
||||
<clr-icon shape="plus"></clr-icon> </button>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- one to many code end here -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- one to many code start here -->
|
||||
<div style="margin-top: 30px;"><h4 style="display: inline;">childform </h4>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-lg-12">
|
||||
<table class="table" style="width:100%;" formArrayName="childform">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">active</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">description</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">name</th>
|
||||
|
||||
|
||||
|
||||
<th class="right" style="width:125px;">{{ childformcontrols.length > 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of childformcontrols; let i=index" [formGroupName]="i">
|
||||
|
||||
|
||||
<td class="left"> <input type="text" formControlName="active" placeholder="Enter active" style="width:180px"
|
||||
class="clr-input"> </td>
|
||||
|
||||
|
||||
|
||||
<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="childformcontrols.length > 1" (click)="onRemovechildform(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<button type="button" class="btn btn-primary button1" (click)="onAddchildform()" >
|
||||
<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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,851 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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.initsupportForm()]),
|
||||
|
||||
age : [null,[Validators.required]],
|
||||
|
||||
age2 : [null,[Validators.required]],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
childform: this._fb.array([this.initchildformForm()]),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Subscribe to value changes for auto calculation
|
||||
this.entryForm.valueChanges.subscribe(() => {
|
||||
this.onInputChangeaddition('add');
|
||||
});
|
||||
|
||||
// Start polling for edit changes
|
||||
this.editInterval = setInterval(() => {
|
||||
if (this.modalEdit) {
|
||||
this.onInputChangeaddition('edit');
|
||||
}
|
||||
}, 200);
|
||||
|
||||
// Subscribe to value changes for auto calculation
|
||||
this.entryForm.valueChanges.subscribe(() => {
|
||||
this.onInputChangemultiplication('add');
|
||||
});
|
||||
|
||||
// Start polling for edit changes
|
||||
this.editInterval = setInterval(() => {
|
||||
if (this.modalEdit) {
|
||||
this.onInputChangemultiplication('edit');
|
||||
}
|
||||
}, 200);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
// one to many start
|
||||
initsupportForm() { return this._fb.group({
|
||||
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
get supportcontrols() {return (this.entryForm.get("support") as FormArray).controls; }
|
||||
onAddsupport() {
|
||||
(<FormArray>this.entryForm.get("support")).push(this.initsupportForm()); }
|
||||
onRemovesupport(index: number) {
|
||||
(<FormArray>this.entryForm.get("support")).removeAt(index); }
|
||||
oneditsupport() { this.supportcomponents.push({
|
||||
|
||||
|
||||
description: "",
|
||||
|
||||
|
||||
|
||||
name: "",
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
deletesupportRow(index) {
|
||||
this.supportcomponents.splice(index, 1);
|
||||
}
|
||||
supportcomponents;
|
||||
// one to many end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// one to many start
|
||||
initchildformForm() { return this._fb.group({
|
||||
|
||||
|
||||
|
||||
active: [null],
|
||||
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
get childformcontrols() {return (this.entryForm.get("childform") as FormArray).controls; }
|
||||
onAddchildform() {
|
||||
(<FormArray>this.entryForm.get("childform")).push(this.initchildformForm()); }
|
||||
onRemovechildform(index: number) {
|
||||
(<FormArray>this.entryForm.get("childform")).removeAt(index); }
|
||||
oneditchildform() { this.childformcomponents.push({
|
||||
|
||||
|
||||
active: "",
|
||||
|
||||
|
||||
|
||||
description: "",
|
||||
|
||||
|
||||
|
||||
name: "",
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
deletechildformRow(index) {
|
||||
this.childformcomponents.splice(index, 1);
|
||||
}
|
||||
childformcomponents;
|
||||
// one to many end
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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.supportcomponents = row.support;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.childformcomponents = row.childform;
|
||||
|
||||
|
||||
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.onInputChangeaddition ('edit');
|
||||
//calculated field end
|
||||
|
||||
//calculated field start
|
||||
|
||||
this.onInputChangemultiplication ('edit');
|
||||
//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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// calculated field code start
|
||||
|
||||
|
||||
|
||||
additionage;
|
||||
|
||||
|
||||
|
||||
additionage2;
|
||||
|
||||
|
||||
|
||||
additiontotal;
|
||||
additioncalculateOperators: 'Addition' | 'Subtraction' | 'Multiplication' | 'Division' | 'Concatination' = "Addition"
|
||||
onInputChangeaddition(mode: 'add' | 'edit') {
|
||||
|
||||
|
||||
const lastObj = 0
|
||||
const lastObjstring = ''
|
||||
if (mode === 'add') {
|
||||
|
||||
|
||||
this.additionage = this.entryForm.value.age || '';
|
||||
|
||||
|
||||
|
||||
this.additionage2 = this.entryForm.value.age2 || '';
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
this.additionage = this.rowSelected.age;
|
||||
|
||||
|
||||
|
||||
this.additionage2 = this.rowSelected.age2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const ageValue = parseFloat(this.additionage) || 0;
|
||||
|
||||
|
||||
|
||||
const age2Value = parseFloat(this.additionage2) || 0;
|
||||
|
||||
|
||||
switch (this.additioncalculateOperators) {
|
||||
case 'Addition':
|
||||
this.additiontotal = (
|
||||
|
||||
|
||||
ageValue +
|
||||
|
||||
|
||||
|
||||
age2Value +
|
||||
|
||||
|
||||
lastObj).toString();
|
||||
break;
|
||||
case 'Subtraction':
|
||||
this.additiontotal = (
|
||||
|
||||
|
||||
ageValue -
|
||||
|
||||
|
||||
|
||||
age2Value -
|
||||
|
||||
|
||||
lastObj).toString();
|
||||
break;
|
||||
case 'Multiplication':
|
||||
this.additiontotal = (
|
||||
|
||||
|
||||
ageValue *
|
||||
|
||||
|
||||
|
||||
age2Value *
|
||||
|
||||
|
||||
1).toString();
|
||||
|
||||
break;
|
||||
case 'Division':
|
||||
|
||||
this.additiontotal = (
|
||||
|
||||
|
||||
ageValue /
|
||||
|
||||
|
||||
|
||||
age2Value /
|
||||
|
||||
|
||||
1).toString();
|
||||
|
||||
break;
|
||||
case 'Concatination':
|
||||
this.additiontotal = `
|
||||
|
||||
|
||||
${this.additionage || ''}
|
||||
|
||||
|
||||
|
||||
${this.additionage2 || ''}
|
||||
|
||||
|
||||
${lastObjstring || ''}`;
|
||||
|
||||
break;
|
||||
default:
|
||||
this.additiontotal = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// calculated field code start
|
||||
|
||||
|
||||
|
||||
multiplicationage;
|
||||
|
||||
|
||||
|
||||
multiplicationage2;
|
||||
|
||||
|
||||
|
||||
multiplicationtotal;
|
||||
multiplicationcalculateOperators: 'Addition' | 'Subtraction' | 'Multiplication' | 'Division' | 'Concatination' = "Multiplication"
|
||||
onInputChangemultiplication(mode: 'add' | 'edit') {
|
||||
|
||||
|
||||
const lastObj = 0
|
||||
const lastObjstring = ''
|
||||
if (mode === 'add') {
|
||||
|
||||
|
||||
this.multiplicationage = this.entryForm.value.age || '';
|
||||
|
||||
|
||||
|
||||
this.multiplicationage2 = this.entryForm.value.age2 || '';
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
this.multiplicationage = this.rowSelected.age;
|
||||
|
||||
|
||||
|
||||
this.multiplicationage2 = this.rowSelected.age2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const ageValue = parseFloat(this.multiplicationage) || 0;
|
||||
|
||||
|
||||
|
||||
const age2Value = parseFloat(this.multiplicationage2) || 0;
|
||||
|
||||
|
||||
switch (this.multiplicationcalculateOperators) {
|
||||
case 'Addition':
|
||||
this.multiplicationtotal = (
|
||||
|
||||
|
||||
ageValue +
|
||||
|
||||
|
||||
|
||||
age2Value +
|
||||
|
||||
|
||||
lastObj).toString();
|
||||
break;
|
||||
case 'Subtraction':
|
||||
this.multiplicationtotal = (
|
||||
|
||||
|
||||
ageValue -
|
||||
|
||||
|
||||
|
||||
age2Value -
|
||||
|
||||
|
||||
lastObj).toString();
|
||||
break;
|
||||
case 'Multiplication':
|
||||
this.multiplicationtotal = (
|
||||
|
||||
|
||||
ageValue *
|
||||
|
||||
|
||||
|
||||
age2Value *
|
||||
|
||||
|
||||
1).toString();
|
||||
|
||||
break;
|
||||
case 'Division':
|
||||
|
||||
this.multiplicationtotal = (
|
||||
|
||||
|
||||
ageValue /
|
||||
|
||||
|
||||
|
||||
age2Value /
|
||||
|
||||
|
||||
1).toString();
|
||||
|
||||
break;
|
||||
case 'Concatination':
|
||||
this.multiplicationtotal = `
|
||||
|
||||
|
||||
${this.multiplicationage || ''}
|
||||
|
||||
|
||||
|
||||
${this.multiplicationage2 || ''}
|
||||
|
||||
|
||||
${lastObjstring || ''}`;
|
||||
|
||||
break;
|
||||
default:
|
||||
this.multiplicationtotal = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Value List field start
|
||||
value_list_fieldMode;
|
||||
searchcusttextvalue_list_field :any;
|
||||
valueListModalvalue_list_field :boolean=false;
|
||||
openvalueListvalue_list_field(mode){
|
||||
this.valueListModalvalue_list_field=!this.valueListModalvalue_list_field ;
|
||||
this.value_list_fieldMode = mode; }
|
||||
customerdatavalue_list_field ;
|
||||
value_list_fielderror;
|
||||
clickedvalue_list_fieldID:number;
|
||||
|
||||
getcustvalue_list_fieldID(id:number){
|
||||
this.clickedvalue_list_fieldID=id;
|
||||
console.log("clicked by id"+ id);
|
||||
this.mainService.getById(id).subscribe((data) => { console.log(data);
|
||||
if(this.value_list_fieldMode == "ADD"){
|
||||
|
||||
|
||||
|
||||
this.entryForm.get('age').setValue(data.age);
|
||||
|
||||
|
||||
|
||||
}else if(this.value_list_fieldMode == "EDIT"){
|
||||
|
||||
|
||||
|
||||
this.rowSelected.age= data. age
|
||||
|
||||
|
||||
|
||||
} }); this.valueListModalvalue_list_field =false;
|
||||
} //value List field end
|
||||
|
||||
//Value List field start
|
||||
value_list_field2Mode;
|
||||
searchcusttextvalue_list_field2 :any;
|
||||
valueListModalvalue_list_field2 :boolean=false;
|
||||
openvalueListvalue_list_field2(mode){
|
||||
this.valueListModalvalue_list_field2=!this.valueListModalvalue_list_field2 ;
|
||||
this.value_list_field2Mode = mode; }
|
||||
customerdatavalue_list_field2 ;
|
||||
value_list_field2error;
|
||||
clickedvalue_list_field2ID:number;
|
||||
|
||||
getcustvalue_list_field2ID(id:number){
|
||||
this.clickedvalue_list_field2ID=id;
|
||||
console.log("clicked by id"+ id);
|
||||
this.mainService.getById(id).subscribe((data) => { console.log(data);
|
||||
if(this.value_list_field2Mode == "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.value_list_field2Mode == "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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
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
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Adv5cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,679 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> Basicp1</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>Basicp1 </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]="'name2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> name2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'number1'"> <ng-container *clrDgHideableColumn="{hidden: false}"> number1
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'number2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> number2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'phone_number'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Phone Number
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'phone_number2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Phone Number2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'paragraph_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Paragraph Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'paragraph_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Paragraph Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'password_field'"> <ng-container *clrDgHideableColumn="{hidden: false}">Password Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'textarea'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Textarea
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'textarea_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Textarea Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'textarea_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Textarea Field2
|
||||
</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.name2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.number1 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.number2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.phone_number }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.phone_number2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goToReplaceStringparagraph_field(user.paragraph_field)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon></clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goToReplaceStringparagraph_field2(user.paragraph_field2)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon></clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.password_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goToReplaceStringtextarea (user.textarea)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
|
||||
</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goToReplaceStringtextarea_field (user.textarea_field)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
|
||||
</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goToReplaceStringtextarea_field2 (user.textarea_field2)" 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)]="rsModalparagraph_field" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
<div class="modal-body">
|
||||
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
|
||||
</div></clr-modal>
|
||||
|
||||
|
||||
<clr-modal [(clrModalOpen)]="rsModalparagraph_field2" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
<div class="modal-body">
|
||||
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
|
||||
</div></clr-modal>
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-modal [(clrModalOpen)]="rsModaltextarea" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
<div class="modal-body">
|
||||
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
|
||||
</div></clr-modal>
|
||||
|
||||
|
||||
<clr-modal [(clrModalOpen)]="rsModaltextarea_field" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
<div class="modal-body">
|
||||
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
|
||||
</div></clr-modal>
|
||||
|
||||
|
||||
<clr-modal [(clrModalOpen)]="rsModaltextarea_field2" [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 Basicp1
|
||||
<!--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>name2</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name2" name="name2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>number1</label>
|
||||
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.number1" name="number1" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>number2</label>
|
||||
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.number2" name="number2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Phone Number</label>
|
||||
<input id="name" class="clr-input" type="Text" [(ngModel)]="rowSelected.phone_number " name="phone_number" pattern="((\\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
|
||||
<div *ngIf="rowSelected.phone_number && !isValidPhone_number(rowSelected.phone_number)" class="error_mess">
|
||||
* Please Follow your pattern,+91 Enter 10 digit Mobile Number.
|
||||
</div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Phone Number2</label>
|
||||
<input id="name" class="clr-input" type="Text" [(ngModel)]="rowSelected.phone_number2 " name="phone_number2" pattern="((\\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
|
||||
<div *ngIf="rowSelected.phone_number2 && !isValidPhone_number2(rowSelected.phone_number2)" class="error_mess">
|
||||
* Please Follow your pattern,+91 Enter 10 digit Mobile Number.
|
||||
</div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Paragraph Field</label>
|
||||
<input id="name" type="Text" class="form-control" style="border: none; outline: none; height:33px !important;" [(ngModel)]="rowSelected.paragraph_field" name=" paragraph_field " /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Paragraph Field2</label>
|
||||
<input id="name" type="Text" class="form-control" style="border: none; outline: none; height:33px !important;" [(ngModel)]="rowSelected.paragraph_field2" name=" paragraph_field2 " /> </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">
|
||||
<clr-icon [attr.shape]="newIconpassword_field" (click)="newShapeChangerpassword_field()"></clr-icon></div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.textarea" name="textarea " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea Field</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.textarea_field" name="textarea_field " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea Field2</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.textarea_field2" name="textarea_field2 " 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 Basicp1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Basicp1_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> name2</label>
|
||||
<input class="clr-input" type="text" formControlName="name2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> number1</label>
|
||||
<input class="clr-input" type="number" formControlName="number1" />
|
||||
<div *ngIf="submitted && entryForm.controls.number1.errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls.number1.errors.required" class="error_mess">*This field is Required</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> number2</label>
|
||||
<input class="clr-input" type="number" formControlName="number2" />
|
||||
<div *ngIf="submitted && entryForm.controls.number2.errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls.number2.errors.required" class="error_mess">*This field is Required</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Phone Number</label>
|
||||
<input class="clr-input" type="text" formControlName="phone_number" pattern="((\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
|
||||
<div *ngIf="submitted && entryForm.controls['phone_number'].errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls['phone_number'].hasError('pattern')" class="error_mess">* Please Follow your pattern,+91 Enter 10 digit Mobile Number.
|
||||
</div> </div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Phone Number2</label>
|
||||
<input class="clr-input" type="text" formControlName="phone_number2" pattern="((\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
|
||||
<div *ngIf="submitted && entryForm.controls['phone_number2'].errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls['phone_number2'].hasError('pattern')" class="error_mess">* Please Follow your pattern,+91 Enter 10 digit Mobile Number.
|
||||
</div> </div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Paragraph Field</label>
|
||||
<input class="form-control" type="Text" formControlName="paragraph_field" style="border: none; outline: none; height:33px !important;" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Paragraph Field2</label>
|
||||
<input class="form-control" type="Text" formControlName="paragraph_field2" style="border: none; outline: none; height:33px !important;" />
|
||||
</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 >
|
||||
<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 class="clr-col-sm-12">
|
||||
<label> Textarea</label>
|
||||
<textarea cols="10" rows="2" formControlName="textarea" placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea Field</label>
|
||||
<textarea cols="10" rows="2" formControlName="textarea_field" placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea Field2</label>
|
||||
<textarea cols="10" rows="2" formControlName="textarea_field2" 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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,533 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Basicp1service} from './Basicp1.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 { Basicp1cardvariable } from './Basicp1_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Basicp1',
|
||||
templateUrl: './Basicp1.component.html',
|
||||
styleUrls: ['./Basicp1.component.scss']
|
||||
})
|
||||
export class Basicp1Component implements OnInit {
|
||||
cardButton = Basicp1cardvariable.cardButton;
|
||||
cardmodeldata = Basicp1cardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Basicp1cardvariable.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 = 'Basicp1_formCode'
|
||||
tableName = 'Basicp1'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Basicp1service,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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],
|
||||
|
||||
name2 : [null],
|
||||
|
||||
number1 : [null,[Validators.required]],
|
||||
|
||||
number2 : [null,[Validators.required]],
|
||||
|
||||
phone_number: ['+91'],
|
||||
|
||||
phone_number2: ['+91'],
|
||||
|
||||
paragraph_field : [null],
|
||||
|
||||
paragraph_field2 : [null],
|
||||
|
||||
password_field : [null],
|
||||
confirmpassword_field : [null],
|
||||
|
||||
textarea : [null],
|
||||
|
||||
textarea_field : [null],
|
||||
|
||||
textarea_field2 : [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 === "Basicp1_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
isValidPhone_number(phone: string): boolean {
|
||||
const phonePattern = /^(\+[1-9][0-9]{0,2})?[1-9][0-9]{9}$/;
|
||||
return phonePattern.test(phone);
|
||||
}
|
||||
|
||||
isValidPhone_number2(phone: string): boolean {
|
||||
const phonePattern = /^(\+[1-9][0-9]{0,2})?[1-9][0-9]{9}$/;
|
||||
return phonePattern.test(phone);
|
||||
}
|
||||
|
||||
rsModalparagraph_field = false;
|
||||
goToReplaceStringparagraph_field (row){
|
||||
this.rowSelected = row; this.rsModalparagraph_field =true; }
|
||||
|
||||
rsModalparagraph_field2 = false;
|
||||
goToReplaceStringparagraph_field2 (row){
|
||||
this.rowSelected = row; this.rsModalparagraph_field2 =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' } }
|
||||
|
||||
rsModaltextarea = false;
|
||||
goToReplaceStringtextarea(row){
|
||||
this.rowSelected = row; this.rsModaltextarea =true; }
|
||||
|
||||
rsModaltextarea_field = false;
|
||||
goToReplaceStringtextarea_field(row){
|
||||
this.rowSelected = row; this.rsModaltextarea_field =true; }
|
||||
|
||||
rsModaltextarea_field2 = false;
|
||||
goToReplaceStringtextarea_field2(row){
|
||||
this.rowSelected = row; this.rsModaltextarea_field2 =true; }
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
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 Basicp1service{
|
||||
private baseURL = "Basicp1/Basicp1" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Basicp1cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,560 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> Basicp2</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>Basicp2 </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]="'about'"> <ng-container *clrDgHideableColumn="{hidden: false}"> about
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'textarea2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Textarea2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'date_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Date Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'date_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Date Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'datetime_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Datetime Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'datetime_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Datetime Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'email_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Email Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'email_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Email Field2
|
||||
</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 (click)="goToReplaceStringabout (user.about)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
|
||||
</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goToReplaceStringtextarea2 (user.textarea2)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
|
||||
</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.date_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.date_field2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.datetime_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.datetime_field2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.email_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.email_field2 }}</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)]="rsModalabout" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
<div class="modal-body">
|
||||
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
|
||||
</div></clr-modal>
|
||||
|
||||
|
||||
<clr-modal [(clrModalOpen)]="rsModaltextarea2" [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 Basicp2
|
||||
<!--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> about</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.about" name="about " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea2</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.textarea2" name="textarea2 " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Date Field</label>
|
||||
<input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.date_field" name="date_field" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Date Field2</label>
|
||||
<input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.date_field2" name="date_field2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Datetime Field</label>
|
||||
<input class="clr-input" type="datetime-local" [(ngModel)]="rowSelected.datetime_field" name="datetime_field" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Datetime Field2</label>
|
||||
<input class="clr-input" type="datetime-local" [(ngModel)]="rowSelected.datetime_field2" name="datetime_field2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Email Field</label>
|
||||
<input id="name" class="clr-input" type="email"
|
||||
[(ngModel)]="rowSelected.email_field " name="email_field" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
|
||||
<div *ngIf="rowSelected.email_field && !isValidemail_field(rowSelected.email_field )" class="error_mess">
|
||||
* Email must be a valid email address.
|
||||
</div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Email Field2</label>
|
||||
<input id="name" class="clr-input" type="email"
|
||||
[(ngModel)]="rowSelected.email_field2 " name="email_field2" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
|
||||
<div *ngIf="rowSelected.email_field2 && !isValidemail_field2(rowSelected.email_field2 )" class="error_mess">
|
||||
* Email must be a valid email address.
|
||||
</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 Basicp2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Basicp2_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> about</label>
|
||||
<textarea cols="10" rows="2" formControlName="about" placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Textarea2</label>
|
||||
<textarea cols="10" rows="2" formControlName="textarea2" placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Date Field</label>
|
||||
<input class="clr-input" type="date" formControlName="date_field" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Date Field2</label>
|
||||
<input class="clr-input" type="date" formControlName="date_field2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Datetime Field</label>
|
||||
<input class="clr-input" type="datetime-local" formControlName="datetime_field" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Datetime Field2</label>
|
||||
<input class="clr-input" type="datetime-local" formControlName="datetime_field2" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Email Field</label>
|
||||
<input class="clr-input" type="email" formControlName="email_field" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
|
||||
<div *ngIf="entryForm.controls['email_field'].errors" class="error_mess">
|
||||
<div *ngIf="entryForm.controls['email_field'].hasError('pattern')" class="error_mess">* Email must be a valid email address
|
||||
</div> </div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Email Field2</label>
|
||||
<input class="clr-input" type="email" formControlName="email_field2" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
|
||||
<div *ngIf="entryForm.controls['email_field2'].errors" class="error_mess">
|
||||
<div *ngIf="entryForm.controls['email_field2'].hasError('pattern')" class="error_mess">* Email must be a valid email address
|
||||
</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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,425 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Basicp2service} from './Basicp2.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 { Basicp2cardvariable } from './Basicp2_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Basicp2',
|
||||
templateUrl: './Basicp2.component.html',
|
||||
styleUrls: ['./Basicp2.component.scss']
|
||||
})
|
||||
export class Basicp2Component implements OnInit {
|
||||
cardButton = Basicp2cardvariable.cardButton;
|
||||
cardmodeldata = Basicp2cardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Basicp2cardvariable.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 = 'Basicp2_formCode'
|
||||
tableName = 'Basicp2'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Basicp2service,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
about : [null],
|
||||
|
||||
textarea2 : [null],
|
||||
|
||||
date_field : [null],
|
||||
|
||||
date_field2 : [null],
|
||||
|
||||
datetime_field : [null],
|
||||
|
||||
datetime_field2 : [null],
|
||||
|
||||
email_field : [null],
|
||||
|
||||
email_field2 : [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 === "Basicp2_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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();
|
||||
|
||||
}
|
||||
rsModalabout = false;
|
||||
goToReplaceStringabout(row){
|
||||
this.rowSelected = row; this.rsModalabout =true; }
|
||||
|
||||
rsModaltextarea2 = false;
|
||||
goToReplaceStringtextarea2(row){
|
||||
this.rowSelected = row; this.rsModaltextarea2 =true; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
isValidemail_field(email: string): boolean {
|
||||
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||
return emailPattern.test(email); }
|
||||
|
||||
isValidemail_field2(email: string): boolean {
|
||||
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||
return emailPattern.test(email); }
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
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 Basicp2service{
|
||||
private baseURL = "Basicp2/Basicp2" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Basicp2cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,627 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> Basicp3</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>Basicp3 </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]="'toggle_switch'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Toggle Switch
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'toggle_switch2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Toggle Switch2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'url_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Url Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'url_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Url Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'decimal_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Decimal Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'decimal_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Decimal Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'percentage_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Percentage Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'percentage_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Percentage Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'documentsequenc'"> <ng-container *clrDgHideableColumn="{hidden: false}"> documentsequenc
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'recaptcha'"> <ng-container *clrDgHideableColumn="{hidden: false}"> recaptcha
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'recaptcha2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> recaptcha2
|
||||
</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.toggle_switch }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.toggle_switch2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goTourl_fieldUrl(user.url_field)" style="cursor: pointer; color: rgb(108, 108, 194);">{{user.url_field}}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell (click)="goTourl_field2Url(user.url_field2)" style="cursor: pointer; color: rgb(108, 108, 194);">{{user.url_field2}}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.decimal_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.decimal_field2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.percentage_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.percentage_field2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.documentsequenc }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.recaptcha }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.recaptcha2 }}</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 Basicp3
|
||||
<!--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> Toggle Switch</label>
|
||||
<input type="checkbox" name="toggle_switch" clrToggle [(ngModel)]="rowSelected.toggle_switch" /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Toggle Switch2</label>
|
||||
<input type="checkbox" name="toggle_switch2" clrToggle [(ngModel)]="rowSelected.toggle_switch2" /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Url Field</label>
|
||||
<input type="url" name="url_field" [(ngModel)]="rowSelected.url_field" placeholder="Enter URL" class="clr-input" pattern="https?://.+">
|
||||
<div *ngIf="!isValidurl_field(rowSelected.url_field )" class="error_mess"> * Please enter a valid URL. </div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Url Field2</label>
|
||||
<input type="url" name="url_field2" [(ngModel)]="rowSelected.url_field2" placeholder="Enter URL" class="clr-input" pattern="https?://.+">
|
||||
<div *ngIf="!isValidurl_field2(rowSelected.url_field2 )" class="error_mess"> * Please enter a valid URL. </div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Decimal Field</label>
|
||||
<input class="clr-input" type="number" step ="0.01" [(ngModel)]="rowSelected.decimal_field" name="decimal_field" /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Decimal Field2</label>
|
||||
<input class="clr-input" type="number" step ="0.01" [(ngModel)]="rowSelected.decimal_field2" name="decimal_field2" /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Percentage Field</label>
|
||||
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.percentage_field" name="percentage_field" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Percentage Field2</label>
|
||||
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.percentage_field2" name="percentage_field2" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> recaptcha</label> <div><b>{{ recaptchaCode }}</b> <button class="btn btn-icon btn-primary btn-sm" (click)="generaterecaptcha()">
|
||||
<clr-icon shape="refresh"></clr-icon> </button></div>
|
||||
<input type="text" name="recaptcha" [(ngModel)]="rowSelected.recaptcha" (ngModelChange)="checkrecaptchaEdit()" class="clr-input">
|
||||
<div *ngIf=" recaptchaMismatch" class="error_mess">
|
||||
<div class="error_mess"> recaptcha not valid.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> recaptcha2</label> <div><b>{{ recaptcha2Code }}</b> <button class="btn btn-icon btn-primary btn-sm" (click)="generaterecaptcha2()">
|
||||
<clr-icon shape="refresh"></clr-icon> </button></div>
|
||||
<input type="text" name="recaptcha2" [(ngModel)]="rowSelected.recaptcha2" (ngModelChange)="checkrecaptcha2Edit()" class="clr-input">
|
||||
<div *ngIf=" recaptcha2Mismatch" class="error_mess">
|
||||
<div class="error_mess"> recaptcha2 not valid.</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" 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 Basicp3
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Basicp3_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> Toggle Switch</label>
|
||||
<input type="checkbox" formControlName="toggle_switch" clrToggle/> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Toggle Switch2</label>
|
||||
<input type="checkbox" formControlName="toggle_switch2" clrToggle/> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Url Field </label>
|
||||
<input type="url" formControlName="url_field" class="clr-input" pattern="https?://.+">
|
||||
<div *ngIf="entryForm.controls['url_field'].errors" class="error_mess">
|
||||
<div *ngIf="entryForm.controls['url_field'].hasError('pattern')" class="error_mess"> * Please enter a valid URL.</div>
|
||||
</div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Url Field2 </label>
|
||||
<input type="url" formControlName="url_field2" class="clr-input" pattern="https?://.+">
|
||||
<div *ngIf="entryForm.controls['url_field2'].errors" class="error_mess">
|
||||
<div *ngIf="entryForm.controls['url_field2'].hasError('pattern')" class="error_mess"> * Please enter a valid URL.</div>
|
||||
</div> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Decimal Field</label>
|
||||
<input type="number" step ="0.01" formControlName="decimal_field" />
|
||||
<div *ngIf="submitted && entryForm.controls.decimal_field.errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls.decimal_field.errors.required" class="error_mess">*This field is Required</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Decimal Field2</label>
|
||||
<input type="number" step ="0.01" formControlName="decimal_field2" />
|
||||
<div *ngIf="submitted && entryForm.controls.decimal_field2.errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls.decimal_field2.errors.required" class="error_mess">*This field is Required</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Percentage Field</label>
|
||||
<input class="clr-input" type="number" formControlName="percentage_field" />
|
||||
<div *ngIf="submitted && entryForm.controls.percentage_field.errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls.percentage_field.errors.required" class="error_mess">*This field is Required</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Percentage Field2</label>
|
||||
<input class="clr-input" type="number" formControlName="percentage_field2" />
|
||||
<div *ngIf="submitted && entryForm.controls.percentage_field2.errors" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls.percentage_field2.errors.required" class="error_mess">*This field is Required</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> recaptcha</label><div><b>{{ recaptchaCode }}</b> <button class="btn btn-icon btn-primary btn-sm" (click)="generaterecaptcha()"><clr-icon shape="refresh"></clr-icon></button></div>
|
||||
<input type="text" formControlName="recaptcha" class="clr-input">
|
||||
<div *ngIf="submitted && entryForm.controls.recaptcha?.errors.required" class="error_mess">*This field is Required</div>
|
||||
<div *ngIf="submitted && entryForm.get('recaptcha')?.errors && entryForm.get('recaptcha')?.dirty" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls['recaptcha']?.hasError('recaptchaMismatch')" class="error_mess"> recaptcha not valid.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> recaptcha2</label><div><b>{{ recaptcha2Code }}</b> <button class="btn btn-icon btn-primary btn-sm" (click)="generaterecaptcha2()"><clr-icon shape="refresh"></clr-icon></button></div>
|
||||
<input type="text" formControlName="recaptcha2" class="clr-input">
|
||||
<div *ngIf="submitted && entryForm.controls.recaptcha2?.errors.required" class="error_mess">*This field is Required</div>
|
||||
<div *ngIf="submitted && entryForm.get('recaptcha2')?.errors && entryForm.get('recaptcha2')?.dirty" class="error_mess">
|
||||
<div *ngIf="submitted && entryForm.controls['recaptcha2']?.hasError('recaptcha2Mismatch')" class="error_mess"> recaptcha2 not valid.</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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,517 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Basicp3service} from './Basicp3.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 { Basicp3cardvariable } from './Basicp3_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Basicp3',
|
||||
templateUrl: './Basicp3.component.html',
|
||||
styleUrls: ['./Basicp3.component.scss']
|
||||
})
|
||||
export class Basicp3Component implements OnInit {
|
||||
cardButton = Basicp3cardvariable.cardButton;
|
||||
cardmodeldata = Basicp3cardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Basicp3cardvariable.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 = 'Basicp3_formCode'
|
||||
tableName = 'Basicp3'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Basicp3service,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
toggle_switch : [true],
|
||||
|
||||
toggle_switch2 : [true],
|
||||
|
||||
url_field : [null],
|
||||
|
||||
url_field2 : [null],
|
||||
|
||||
decimal_field : [null,[Validators.required]],
|
||||
|
||||
decimal_field2 : [null,[Validators.required]],
|
||||
|
||||
percentage_field : [null,[Validators.required]],
|
||||
|
||||
percentage_field2 : [null,[Validators.required]],
|
||||
|
||||
documentsequenc : [null],
|
||||
|
||||
recaptcha : ['', [Validators.required,this.checkrecaptcha.bind(this)]],
|
||||
|
||||
recaptcha2 : ['', [Validators.required,this.checkrecaptcha2.bind(this)]],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // 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 === "Basicp3_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.generaterecaptcha()
|
||||
|
||||
this.generaterecaptcha2()
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
isValidurl_field(url: string): boolean {
|
||||
return /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/.test(url); }
|
||||
goTourl_fieldUrl(val){ window.open(val) }
|
||||
|
||||
isValidurl_field2(url: string): boolean {
|
||||
return /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/.test(url); }
|
||||
goTourl_field2Url(val){ window.open(val) }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
recaptchaCode = '';
|
||||
generaterecaptcha (): void {
|
||||
const possibleCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const codeLength = 6; // Change to desired length
|
||||
|
||||
let recaptcha= '';
|
||||
for (let i = 0; i < codeLength; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * possibleCharacters.length);
|
||||
recaptcha += possibleCharacters.charAt(randomIndex);
|
||||
}
|
||||
this.recaptchaCode = recaptcha;
|
||||
}
|
||||
|
||||
checkrecaptcha(control: AbstractControl): ValidationErrors | null {
|
||||
if (control.value !== this.recaptchaCode) {
|
||||
return { recaptchaMismatch: true };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
recaptchaMismatch = false;
|
||||
|
||||
checkrecaptchaEdit(): void {
|
||||
if (this.rowSelected.recaptcha !== this. recaptchaCode) {
|
||||
this. recaptchaMismatch = true; } else { this.recaptchaMismatch = false; } }
|
||||
|
||||
recaptcha2Code = '';
|
||||
generaterecaptcha2 (): void {
|
||||
const possibleCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const codeLength = 6; // Change to desired length
|
||||
|
||||
let recaptcha2= '';
|
||||
for (let i = 0; i < codeLength; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * possibleCharacters.length);
|
||||
recaptcha2 += possibleCharacters.charAt(randomIndex);
|
||||
}
|
||||
this.recaptcha2Code = recaptcha2;
|
||||
}
|
||||
|
||||
checkrecaptcha2(control: AbstractControl): ValidationErrors | null {
|
||||
if (control.value !== this.recaptcha2Code) {
|
||||
return { recaptcha2Mismatch: true };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
recaptcha2Mismatch = false;
|
||||
|
||||
checkrecaptcha2Edit(): void {
|
||||
if (this.rowSelected.recaptcha2 !== this. recaptcha2Code) {
|
||||
this. recaptcha2Mismatch = true; } else { this.recaptcha2Mismatch = false; } }
|
||||
|
||||
// updateaction
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
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 Basicp3service{
|
||||
private baseURL = "Basicp3/Basicp3" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Basicp3cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,688 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> Dv2</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>Dv2 </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]="' test3'"> <ng-container *clrDgHideableColumn="{hidden: false}"> test3
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="' name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> name
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="' last_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> last_name
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="' test'"> <ng-container *clrDgHideableColumn="{hidden: false}"> test
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'currency'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Currency
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'currency2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Currency2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'qrcode_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> QRCode Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'qrcode_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> QRCode Field2
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'barcode_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> BarCode Field
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'barcode_field2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> BarCode Field2
|
||||
</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. test3}}</clr-dg-cell>
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user. name}}</clr-dg-cell>
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user. last_name}}</clr-dg-cell>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user. test}}</clr-dg-cell>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.currency }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.currency2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.qrcode_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.qrcode_field2 }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.barcode_field }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.barcode_field2 }}</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 Dv2
|
||||
<!--update button -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3>
|
||||
<div class="modal-body" *ngIf="rowSelected.id">
|
||||
<h2 class="heading">{{rowSelected.id}}</h2>
|
||||
<!-- button -->
|
||||
<form >
|
||||
<div class="clr-row">
|
||||
<!-- multiselect field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Address</label>
|
||||
<div class="clr-form-control" style="margin-top: 5px;margin-bottom: 10px;">
|
||||
<div class="clr-control-container">
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>test3</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.test3" name="test3" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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>last_name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.last_name" name="last_name" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- multiselect field end -->
|
||||
|
||||
<!-- multiselect field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> per address</label>
|
||||
<div class="clr-form-control" style="margin-top: 5px;margin-bottom: 10px;">
|
||||
<div class="clr-control-container">
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>test</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.test" name="test" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- multiselect field end -->
|
||||
|
||||
<!-- currency field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Currency</label>
|
||||
<input type="number" class="clr-input" [(ngModel)]="rowSelected.currency" name="currency" (blur)="formatCurrencycurrency()" [value]="rowSelected.currency | removeCommas">
|
||||
</div>
|
||||
<!-- currency field end -->
|
||||
|
||||
<!-- currency field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Currency2</label>
|
||||
<input type="number" class="clr-input" [(ngModel)]="rowSelected.currency2" name="currency2" (blur)="formatCurrencycurrency2()" [value]="rowSelected.currency2 | removeCommas">
|
||||
</div>
|
||||
<!-- currency field end -->
|
||||
|
||||
<!-- qrCode field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> QRCode Field</label>
|
||||
<input class="clr-input" type="text" name="qrcode_field" [(ngModel)]="rowSelected.qrcode_field" />
|
||||
<qrcode [qrdata]="rowSelected.qrcode_field ? rowSelected.qrcode_field : '' " [width]="135" [errorCorrectionLevel]="'M'"></qrcode>
|
||||
</div>
|
||||
<!-- qrCode field end -->
|
||||
|
||||
<!-- qrCode field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> QRCode Field2</label>
|
||||
<input class="clr-input" type="text" name="qrcode_field2" [(ngModel)]="rowSelected.qrcode_field2" />
|
||||
<qrcode [qrdata]="rowSelected.qrcode_field2 ? rowSelected.qrcode_field2 : '' " [width]="135" [errorCorrectionLevel]="'M'"></qrcode>
|
||||
</div>
|
||||
<!-- qrCode field end -->
|
||||
|
||||
<!-- bar code field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> BarCode Field</label>
|
||||
<input type="text" class="clr-input" name="barcode_field" [(ngModel)]="rowSelected.barcode_field" (input)="generateBarcodebarcode_field($event.target.value)" /> <svg id="barcodebarcode_field"></svg>
|
||||
</div> <!-- bar code field end -->
|
||||
|
||||
<!-- bar code field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> BarCode Field2</label>
|
||||
<input type="text" class="clr-input" name="barcode_field2" [(ngModel)]="rowSelected.barcode_field2" (input)="generateBarcodebarcode_field2($event.target.value)" /> <svg id="barcodebarcode_field2"></svg>
|
||||
</div> <!-- bar code field end -->
|
||||
|
||||
|
||||
|
||||
</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 Dv2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Dv2_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;">
|
||||
|
||||
<!-- multiselect field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Address</label>
|
||||
<div class="clr-form-control" style="margin-top: 5px;margin-bottom: 10px;">
|
||||
<div class="clr-control-container">
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> test3</label>
|
||||
<input class="clr-input" type="text" formControlName="test3" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<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> last_name</label>
|
||||
<input class="clr-input" type="text" formControlName="last_name" />
|
||||
</div>
|
||||
|
||||
|
||||
</div> </div> </div>
|
||||
<!-- multiselect field end -->
|
||||
|
||||
<!-- multiselect field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> per address</label>
|
||||
<div class="clr-form-control" style="margin-top: 5px;margin-bottom: 10px;">
|
||||
<div class="clr-control-container">
|
||||
|
||||
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> test</label>
|
||||
<input class="clr-input" type="text" formControlName="test" />
|
||||
</div>
|
||||
|
||||
|
||||
</div> </div> </div>
|
||||
<!-- multiselect field end -->
|
||||
|
||||
<!-- currency field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Currency</label>
|
||||
<input type="number" class="clr-input" formControlName="currency" [value]="entryForm.value.currency | number:'1.2-2' | removeCommas">
|
||||
</div>
|
||||
<!-- currency field end -->
|
||||
|
||||
<!-- currency field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Currency2</label>
|
||||
<input type="number" class="clr-input" formControlName="currency2" [value]="entryForm.value.currency2 | number:'1.2-2' | removeCommas">
|
||||
</div>
|
||||
<!-- currency field end -->
|
||||
|
||||
<!-- qrCode field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label>QRCode Field</label>
|
||||
<input class="clr-input" type="text" formControlName="qrcode_field" />
|
||||
<qrcode [qrdata]="entryForm.value.qrcode_field ? entryForm.value.qrcode_field : '' " [width]="135" [errorCorrectionLevel]="'M'" ></qrcode> </div>
|
||||
<!-- qrCode field end -->
|
||||
|
||||
<!-- qrCode field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label>QRCode Field2</label>
|
||||
<input class="clr-input" type="text" formControlName="qrcode_field2" />
|
||||
<qrcode [qrdata]="entryForm.value.qrcode_field2 ? entryForm.value.qrcode_field2 : '' " [width]="135" [errorCorrectionLevel]="'M'" ></qrcode> </div>
|
||||
<!-- qrCode field end -->
|
||||
|
||||
<!-- bar code field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> BarCode Field</label>
|
||||
<input type="text" class="clr-input" formControlName="barcode_field" (input)="generateBarcodebarcode_field($event.target.value)" />
|
||||
<svg id="barcodebarcode_field"></svg> </div>
|
||||
<!-- bar code field end -->
|
||||
|
||||
<!-- bar code field start -->
|
||||
<div class="clr-col-sm-12">
|
||||
<label> BarCode Field2</label>
|
||||
<input type="text" class="clr-input" formControlName="barcode_field2" (input)="generateBarcodebarcode_field2($event.target.value)" />
|
||||
<svg id="barcodebarcode_field2"></svg> </div>
|
||||
<!-- bar code field end -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- form code start -->
|
||||
<div *ngIf="checkFormCode">
|
||||
<h4 style="font-weight: 300;display: inline;">Extension</h4>
|
||||
<br>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
|
||||
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
|
||||
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
|
||||
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
|
||||
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
|
||||
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-checkbox" />
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- form code end --> <div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</clr-modal>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- htmlpopup -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,471 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Dv2service} from './Dv2.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 { Dv2cardvariable } from './Dv2_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Dv2',
|
||||
templateUrl: './Dv2.component.html',
|
||||
styleUrls: ['./Dv2.component.scss']
|
||||
})
|
||||
export class Dv2Component implements OnInit {
|
||||
cardButton = Dv2cardvariable.cardButton;
|
||||
cardmodeldata = Dv2cardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Dv2cardvariable.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 = 'Dv2_formCode'
|
||||
tableName = 'Dv2'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Dv2service,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
|
||||
|
||||
test3:[null],
|
||||
|
||||
|
||||
|
||||
name:[null],
|
||||
|
||||
|
||||
|
||||
last_name:[null],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
test:[null],
|
||||
|
||||
|
||||
|
||||
currency : [null, { updateOn: 'blur' }],
|
||||
|
||||
currency2 : [null, { updateOn: 'blur' }],
|
||||
|
||||
qrcode_field : [null],
|
||||
|
||||
qrcode_field2 : [null],
|
||||
|
||||
barcode_field : [null],
|
||||
|
||||
barcode_field2 : [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 === "Dv2_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// bar code field start
|
||||
setTimeout(function(){
|
||||
JsBarcode("#barcodebarcode_field", row?.barcode_field);
|
||||
}, 500);
|
||||
// bar code field start
|
||||
|
||||
// bar code field start
|
||||
setTimeout(function(){
|
||||
JsBarcode("#barcodebarcode_field2", row?.barcode_field2);
|
||||
}, 500);
|
||||
// bar code field start
|
||||
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//currency field start
|
||||
formatCurrencycurrency () {
|
||||
// Format the currency with two decimal places
|
||||
this.rowSelected.currency = Number(this.rowSelected.currency ).toFixed(2);
|
||||
// Remove commas from the formatted currency
|
||||
this.rowSelected.currency = this.rowSelected.currency?.replace(/,/g, ''); }
|
||||
//currency field end
|
||||
|
||||
//currency field start
|
||||
formatCurrencycurrency2 () {
|
||||
// Format the currency with two decimal places
|
||||
this.rowSelected.currency2 = Number(this.rowSelected.currency2 ).toFixed(2);
|
||||
// Remove commas from the formatted currency
|
||||
this.rowSelected.currency2 = this.rowSelected.currency2?.replace(/,/g, ''); }
|
||||
//currency field end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//bar code field start
|
||||
generateBarcodebarcode_field(value) {
|
||||
const barcodeValue = value;
|
||||
const barcodeElement = document.getElementById("barcodebarcode_field");
|
||||
if (barcodeElement) { if (barcodeValue) {
|
||||
JsBarcode(barcodeElement, barcodeValue, { format: "CODE128"
|
||||
}); } else {
|
||||
// Clear the barcode if the input is empty
|
||||
barcodeElement.innerHTML = ''; } } }
|
||||
// bar code field end
|
||||
|
||||
//bar code field start
|
||||
generateBarcodebarcode_field2(value) {
|
||||
const barcodeValue = value;
|
||||
const barcodeElement = document.getElementById("barcodebarcode_field2");
|
||||
if (barcodeElement) { if (barcodeValue) {
|
||||
JsBarcode(barcodeElement, barcodeValue, { format: "CODE128"
|
||||
}); } else {
|
||||
// Clear the barcode if the input is empty
|
||||
barcodeElement.innerHTML = ''; } } }
|
||||
// bar code field end
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
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 Dv2service{
|
||||
private baseURL = "Dv2/Dv2" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Dv2cardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -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 -->
|
||||
|
||||
<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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,251 @@
|
||||
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,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Supportcardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,376 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> Childform</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>Childform </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]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
|
||||
</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.active }}</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 Childform
|
||||
<!--update button -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3>
|
||||
<div class="modal-body" *ngIf="rowSelected.id">
|
||||
<h2 class="heading">{{rowSelected.id}}</h2>
|
||||
<!-- button -->
|
||||
<form >
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Description</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Active</label>
|
||||
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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 Childform
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Childform_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> Active</label>
|
||||
<input type="checkbox" formControlName="active" clrToggle/> </div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- form code start -->
|
||||
<div *ngIf="checkFormCode">
|
||||
<h4 style="font-weight: 300;display: inline;">Extension</h4>
|
||||
<br>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
|
||||
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
|
||||
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
|
||||
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
|
||||
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
|
||||
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-checkbox" />
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- form code end --> <div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</clr-modal>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- htmlpopup -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,275 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Childformservice} from './Childform.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 { Childformcardvariable } from './Childform_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Childform',
|
||||
templateUrl: './Childform.component.html',
|
||||
styleUrls: ['./Childform.component.scss']
|
||||
})
|
||||
export class ChildformComponent implements OnInit {
|
||||
cardButton = Childformcardvariable.cardButton;
|
||||
cardmodeldata = Childformcardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Childformcardvariable.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 = 'Childform_formCode'
|
||||
tableName = 'Childform'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Childformservice,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// component button
|
||||
ngOnInit(): void {
|
||||
if(this.cardmodeldata !== ''){
|
||||
this.cardmodal = JSON.parse(this.cardmodeldata);
|
||||
this.dashboardArray = this.cardmodal.dashboard.slice();
|
||||
console.log(this.dashboardArray)
|
||||
}
|
||||
this.userrole=this.userInfoService.getRoles();
|
||||
this.getData();
|
||||
this.entryForm = this._fb.group({
|
||||
name : [null],
|
||||
|
||||
description : [null],
|
||||
|
||||
active : [true],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // 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 === "Childform_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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 Childformservice{
|
||||
private baseURL = "Childform/Childform" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Childformcardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,376 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> Country</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>Country </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]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
|
||||
</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.active }}</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 Country
|
||||
<!--update button -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3>
|
||||
<div class="modal-body" *ngIf="rowSelected.id">
|
||||
<h2 class="heading">{{rowSelected.id}}</h2>
|
||||
<!-- button -->
|
||||
<form >
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-sm-12">
|
||||
<label>Name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Description</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Active</label>
|
||||
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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 Country
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Country_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> Active</label>
|
||||
<input type="checkbox" formControlName="active" clrToggle/> </div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- form code start -->
|
||||
<div *ngIf="checkFormCode">
|
||||
<h4 style="font-weight: 300;display: inline;">Extension</h4>
|
||||
<br>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
|
||||
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
|
||||
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
|
||||
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-input" />
|
||||
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
|
||||
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
|
||||
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
|
||||
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
|
||||
class="clr-checkbox" />
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- form code end --> <div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</clr-modal>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- htmlpopup -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,275 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Countryservice} from './Country.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 { Countrycardvariable } from './Country_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-Country',
|
||||
templateUrl: './Country.component.html',
|
||||
styleUrls: ['./Country.component.scss']
|
||||
})
|
||||
export class CountryComponent implements OnInit {
|
||||
cardButton = Countrycardvariable.cardButton;
|
||||
cardmodeldata = Countrycardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Countrycardvariable.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 = 'Country_formCode'
|
||||
tableName = 'Country'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Countryservice,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// component button
|
||||
ngOnInit(): void {
|
||||
if(this.cardmodeldata !== ''){
|
||||
this.cardmodal = JSON.parse(this.cardmodeldata);
|
||||
this.dashboardArray = this.cardmodal.dashboard.slice();
|
||||
console.log(this.dashboardArray)
|
||||
}
|
||||
this.userrole=this.userInfoService.getRoles();
|
||||
this.getData();
|
||||
this.entryForm = this._fb.group({
|
||||
name : [null],
|
||||
|
||||
description : [null],
|
||||
|
||||
active : [true],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // 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 === "Country_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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 Countryservice{
|
||||
private baseURL = "Country/Country" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Countrycardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,405 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> District</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>District </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]="'district_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> district 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]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'state_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> state 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.district_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.active }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.state_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>
|
||||
|
||||
|
||||
|
||||
<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 District
|
||||
<!--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>district name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.district_name" name="district_name" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Description</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Active</label>
|
||||
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>state name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.state_name" name="state_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 District
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'District_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> district name</label>
|
||||
<input class="clr-input" type="text" formControlName="district_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> Active</label>
|
||||
<input type="checkbox" formControlName="active" clrToggle/> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> state name</label>
|
||||
<input class="clr-input" type="text" formControlName="state_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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,299 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Districtservice} from './District.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 { Districtcardvariable } from './District_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-District',
|
||||
templateUrl: './District.component.html',
|
||||
styleUrls: ['./District.component.scss']
|
||||
})
|
||||
export class DistrictComponent implements OnInit {
|
||||
cardButton = Districtcardvariable.cardButton;
|
||||
cardmodeldata = Districtcardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Districtcardvariable.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 = 'District_formCode'
|
||||
tableName = 'District'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Districtservice,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
district_name : [null],
|
||||
|
||||
description : [null],
|
||||
|
||||
active : [true],
|
||||
|
||||
state_name : [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 === "District_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs";
|
||||
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
|
||||
import { ApiRequestService } from "src/app/services/api/api-request.service";
|
||||
import { environment } from 'src/environments/environment';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class Districtservice{
|
||||
private baseURL = "District/District" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Districtcardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -0,0 +1,405 @@
|
||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||
<li><a href="javascript://"> State</a></li>
|
||||
</ol>
|
||||
<div class="dg-wrapper">
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-8">
|
||||
<h3>State </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]="'state_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> state 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]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
|
||||
</ng-container></clr-dg-column>
|
||||
|
||||
|
||||
<clr-dg-column [clrDgField]="'country_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> country 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.state_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.active }}</clr-dg-cell>
|
||||
|
||||
|
||||
<clr-dg-cell>{{user.country_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>
|
||||
|
||||
|
||||
|
||||
<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 State
|
||||
<!--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>state name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.state_name" name="state_name" />
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Description</label>
|
||||
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
|
||||
</div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> Active</label>
|
||||
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label>country name</label>
|
||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.country_name" name="country_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 State
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
class="tooltip tooltip-sm tooltip-bottom-left">
|
||||
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'State_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> state name</label>
|
||||
<input class="clr-input" type="text" formControlName="state_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> Active</label>
|
||||
<input type="checkbox" formControlName="active" clrToggle/> </div>
|
||||
|
||||
<div class="clr-col-sm-12">
|
||||
<label> country name</label>
|
||||
<input class="clr-input" type="text" formControlName="country_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 -->
|
||||
@ -0,0 +1,85 @@
|
||||
//@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;
|
||||
}
|
||||
.universal-section-header {
|
||||
margin: 24px 0 10px 0;
|
||||
font-weight: 600;
|
||||
color: #1a237e;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@ -0,0 +1,299 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Stateservice} from './State.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 { Statecardvariable } from './State_cardvariable';
|
||||
import { UserInfoService } from 'src/app/services/user-info.service';
|
||||
declare var JsBarcode: any;
|
||||
@Component({
|
||||
selector: 'app-State',
|
||||
templateUrl: './State.component.html',
|
||||
styleUrls: ['./State.component.scss']
|
||||
})
|
||||
export class StateComponent implements OnInit {
|
||||
cardButton = Statecardvariable.cardButton;
|
||||
cardmodeldata = Statecardvariable.cardmodeldata;
|
||||
public dashboardArray: DashboardContentModel2[];
|
||||
isCardview = Statecardvariable.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 = 'State_formCode'
|
||||
tableName = 'State'; checkFormCode; selected: any[] = []; constructor(
|
||||
private extensionService: ExtensionService,
|
||||
private userInfoService:UserInfoService,
|
||||
private mainService:Stateservice,
|
||||
private alertService: AlertService,
|
||||
private toastr: ToastrService,
|
||||
private _fb: FormBuilder,
|
||||
) { }
|
||||
private editInterval: any;
|
||||
// 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({
|
||||
state_name : [null],
|
||||
|
||||
description : [null],
|
||||
|
||||
active : [true],
|
||||
|
||||
country_name : [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 === "State_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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
clearInterval(this.editInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
console.log(data);
|
||||
this.product = data;
|
||||
this.product = [...this.product].reverse(); 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs";
|
||||
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
|
||||
import { ApiRequestService } from "src/app/services/api/api-request.service";
|
||||
import { environment } from 'src/environments/environment';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class Stateservice{
|
||||
private baseURL = "State/State" ; constructor(
|
||||
private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, data);
|
||||
}
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
export const Statecardvariable = {
|
||||
"cardButton": false,
|
||||
"cardmodeldata": ``
|
||||
}
|
||||
@ -1,3 +1,20 @@
|
||||
import { ChildformComponent } from './BuilderComponents/stpkg/Childform/Childform.component';
|
||||
import { DistrictComponent } from './BuilderComponents/testdata/District/District.component';
|
||||
import { StateComponent } from './BuilderComponents/testdata/State/State.component';
|
||||
import { CountryComponent } from './BuilderComponents/testdata/Country/Country.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 { Dv2Component } from './BuilderComponents/angulardatatype/Dv2/Dv2.component';
|
||||
import { Adv1Component } from './BuilderComponents/angulardatatype/Adv1/Adv1.component';
|
||||
import { Basicp3Component } from './BuilderComponents/angulardatatype/Basicp3/Basicp3.component';
|
||||
import { Basicp2Component } from './BuilderComponents/angulardatatype/Basicp2/Basicp2.component';
|
||||
import { Basicp1Component } from './BuilderComponents/angulardatatype/Basicp1/Basicp1.component';
|
||||
|
||||
import { SequencegenaratorComponent } from './fnd/sequencegenarator/sequencegenarator.component';
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
@ -260,6 +277,57 @@ const routes: Routes = [
|
||||
|
||||
|
||||
// buildercomponents
|
||||
{path:'Childform',component:ChildformComponent},
|
||||
|
||||
|
||||
{path:'District',component:DistrictComponent},
|
||||
|
||||
|
||||
{path:'State',component:StateComponent},
|
||||
|
||||
|
||||
{path:'Country',component:CountryComponent},
|
||||
|
||||
|
||||
{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},
|
||||
|
||||
|
||||
{path:'Dv2',component:Dv2Component},
|
||||
|
||||
|
||||
{path:'Adv1',component:Adv1Component},
|
||||
|
||||
|
||||
{path:'Basicp3',component:Basicp3Component},
|
||||
|
||||
|
||||
{path:'Basicp2',component:Basicp2Component},
|
||||
|
||||
|
||||
{path:'Basicp1',component:Basicp1Component},
|
||||
|
||||
|
||||
|
||||
{ path: 'tokenregistery', component: Token_registeryComponent },
|
||||
|
||||
|
||||
@ -1,3 +1,20 @@
|
||||
import { ChildformComponent } from './BuilderComponents/stpkg/Childform/Childform.component';
|
||||
import { DistrictComponent } from './BuilderComponents/testdata/District/District.component';
|
||||
import { StateComponent } from './BuilderComponents/testdata/State/State.component';
|
||||
import { CountryComponent } from './BuilderComponents/testdata/Country/Country.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 { Dv2Component } from './BuilderComponents/angulardatatype/Dv2/Dv2.component';
|
||||
import { Adv1Component } from './BuilderComponents/angulardatatype/Adv1/Adv1.component';
|
||||
import { Basicp3Component } from './BuilderComponents/angulardatatype/Basicp3/Basicp3.component';
|
||||
import { Basicp2Component } from './BuilderComponents/angulardatatype/Basicp2/Basicp2.component';
|
||||
import { Basicp1Component } from './BuilderComponents/angulardatatype/Basicp1/Basicp1.component';
|
||||
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
@ -133,6 +150,57 @@ import { MyworkspaceComponent } from './admin/myworkspace/myworkspace.component'
|
||||
|
||||
|
||||
// buildercomponents
|
||||
ChildformComponent,
|
||||
|
||||
|
||||
DistrictComponent,
|
||||
|
||||
|
||||
StateComponent,
|
||||
|
||||
|
||||
CountryComponent,
|
||||
|
||||
|
||||
Ad9Component,
|
||||
|
||||
|
||||
Ad8Component,
|
||||
|
||||
|
||||
Ad7Component,
|
||||
|
||||
|
||||
Ad6Component,
|
||||
|
||||
|
||||
Adv5Component,
|
||||
|
||||
|
||||
Adv4Component,
|
||||
|
||||
|
||||
SupportComponent,
|
||||
|
||||
|
||||
Adv3Component,
|
||||
|
||||
|
||||
Dv2Component,
|
||||
|
||||
|
||||
Adv1Component,
|
||||
|
||||
|
||||
Basicp3Component,
|
||||
|
||||
|
||||
Basicp2Component,
|
||||
|
||||
|
||||
Basicp1Component,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -228,113 +228,82 @@
|
||||
"SUB_MENU": "Sub Menu",
|
||||
"video_Field2": "video_Field2",
|
||||
"video_Field": "video_Field",
|
||||
"numadd": "numadd",
|
||||
"Support": "Support",
|
||||
"about": "about",
|
||||
"Button_Field2": "Button_Field2",
|
||||
"autotest": "autotest",
|
||||
"Childform": "Childform",
|
||||
"Test2": "Test2",
|
||||
"Chtes2": "Chtes2",
|
||||
"documentsequenc": "documentsequenc",
|
||||
"state_name": "state_name",
|
||||
"Currency": "Currency",
|
||||
"token_name": "token_name",
|
||||
"state": "state",
|
||||
"Adv5": "Adv5",
|
||||
"Adv4": "Adv4",
|
||||
"Adv3": "Adv3",
|
||||
"addition": "addition",
|
||||
"automulti": "automulti",
|
||||
"calculated_Field": "calculated_Field",
|
||||
"counrymulti": "counrymulti",
|
||||
"Paragraph_Field2": "Paragraph_Field2",
|
||||
"Number_Field": "Number_Field",
|
||||
"Basicp1": "Basicp1",
|
||||
"Sum": "Sum",
|
||||
"ButtonUpdate": "ButtonUpdate",
|
||||
"datagrid_Field": "datagrid_Field",
|
||||
"Email_Field": "Email_Field",
|
||||
"datagrid_Field": "datagrid_Field",
|
||||
"audio_Field2": "audio_Field2",
|
||||
"QRCode_Field2": "QRCode_Field2",
|
||||
"dylist": "dylist",
|
||||
"Basicp3": "Basicp3",
|
||||
"Basicp2": "Basicp2",
|
||||
"stmlit": "stmlit",
|
||||
"1ega": "1ega",
|
||||
"Country": "Country",
|
||||
"BarCode_Field2": "BarCode_Field2",
|
||||
"Country": "Country",
|
||||
"Imageupload_Field": "Imageupload_Field",
|
||||
"dy2": "dy2",
|
||||
"name2": "name2",
|
||||
"idfemale": "idfemale",
|
||||
"dy1": "dy1",
|
||||
"dy2": "dy2",
|
||||
"Url_Field2": "Url_Field2",
|
||||
"t1": "t1",
|
||||
"age2": "age2",
|
||||
"dy1": "dy1",
|
||||
"t2": "t2",
|
||||
"age1": "age1",
|
||||
"Sum2": "Sum2",
|
||||
"age2": "age2",
|
||||
"t4": "t4",
|
||||
"Decimal_Field2": "Decimal_Field2",
|
||||
"Description": "Description",
|
||||
"gender": "gender",
|
||||
"select_Field": "select_Field",
|
||||
"QRCode_Field": "QRCode_Field",
|
||||
"Datetime_Field": "Datetime_Field",
|
||||
"sum": "sum",
|
||||
"test1": "test1",
|
||||
"Test11": "Test11",
|
||||
"Checkout_Field": "Checkout_Field",
|
||||
"Ad6": "Ad6",
|
||||
"picupload": "picupload",
|
||||
"Textarea_Field": "Textarea_Field",
|
||||
"Textarea": "Textarea",
|
||||
"Ad8": "Ad8",
|
||||
"Ad7": "Ad7",
|
||||
"Ad9": "Ad9",
|
||||
"num1": "num1",
|
||||
"multiplication": "multiplication",
|
||||
"Date_Field": "Date_Field",
|
||||
"num3": "num3",
|
||||
"num2": "num2",
|
||||
"Token_registery": "Token_registery",
|
||||
"dymulti": "dymulti",
|
||||
"Toggle_Switch": "Toggle_Switch",
|
||||
"last_name": "last_name",
|
||||
"atoc": "atoc",
|
||||
"Percentage_Field2": "Percentage_Field2",
|
||||
"Test22": "Test22",
|
||||
"Date_Field2": "Date_Field2",
|
||||
"default_Prce": "default_Prce",
|
||||
"token": "token",
|
||||
"test2": "test2",
|
||||
"test3": "test3",
|
||||
"dymlti1": "dymlti1",
|
||||
"Fileupload_Field2": "Fileupload_Field2",
|
||||
"audio_Field": "audio_Field",
|
||||
"mobile_number": "mobile_number",
|
||||
"Decimal_Field": "Decimal_Field",
|
||||
"country": "country",
|
||||
"ismale": "ismale",
|
||||
"Currency2": "Currency2",
|
||||
"Name": "Name",
|
||||
"atc2": "atc2",
|
||||
"data_grid_Field": "data_grid_Field",
|
||||
"BarCode_Field": "BarCode_Field",
|
||||
"Imageupload_Field2": "Imageupload_Field2",
|
||||
"BarCode_Field": "BarCode_Field",
|
||||
"recaptcha2": "recaptcha2",
|
||||
"Buttonupdate2": "Buttonupdate2",
|
||||
"test": "test",
|
||||
"atdy1": "atdy1",
|
||||
"Phone_Number2": "Phone_Number2",
|
||||
"atdy2": "atdy2",
|
||||
"Sttest": "Sttest",
|
||||
"Percentage_Field": "Percentage_Field",
|
||||
"Textarea2": "Textarea2",
|
||||
"Url_Field": "Url_Field",
|
||||
"Active": "Active",
|
||||
"dymlt2": "dymlt2",
|
||||
"Active": "Active",
|
||||
"Paragraph_Field": "Paragraph_Field",
|
||||
"State": "State",
|
||||
"district": "district",
|
||||
@ -343,7 +312,6 @@
|
||||
"Email_Field2": "Email_Field2",
|
||||
"Static": "Static",
|
||||
"District": "District",
|
||||
"about_yourself": "about_yourself",
|
||||
"datagrid_Field2": "datagrid_Field2",
|
||||
"Toggle_Switch2": "Toggle_Switch2",
|
||||
"Dv2": "Dv2",
|
||||
@ -351,8 +319,8 @@
|
||||
"description": "description",
|
||||
"number1": "number1",
|
||||
"Phone_Number": "Phone_Number",
|
||||
"Fileupload_Field": "Fileupload_Field",
|
||||
"number2": "number2",
|
||||
"Fileupload_Field": "Fileupload_Field",
|
||||
"Value_List_Field": "Value_List_Field",
|
||||
"Value_List_Field2": "Value_List_Field2",
|
||||
"district_name": "district_name",
|
||||
@ -360,15 +328,11 @@
|
||||
"recaptcha": "recaptcha",
|
||||
"stmmlt2": "stmmlt2",
|
||||
"country_name": "country_name",
|
||||
"Dependent_Dropdown_Field": "Dependent_Dropdown_Field",
|
||||
"Adv1": "Adv1",
|
||||
"OneToManyExtension": "OneToManyExtension",
|
||||
"Datetime_Field2": "Datetime_Field2",
|
||||
"country_list": "country_list",
|
||||
"Textarea_Field2": "Textarea_Field2",
|
||||
"Defatest": "Defatest",
|
||||
"Approved_Field": "Approved_Field",
|
||||
"select_Field2": "select_Field2",
|
||||
"Password_Field": "Password_Field",
|
||||
"age": "age",
|
||||
"Button_Field": "Button_Field"
|
||||
|
||||
@ -69,6 +69,57 @@ public class BuilderService {
|
||||
executeDump(true);
|
||||
|
||||
// ADD OTHER SERVICE
|
||||
addCustomMenu( "Childform","Childform", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "District","District", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "State","State", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Country","Country", "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");
|
||||
|
||||
|
||||
addCustomMenu( "Dv2","Dv2", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Adv1","Adv1", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Basicp3","Basicp3", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Basicp2","Basicp2", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Basicp1","Basicp1", "Transcations");
|
||||
|
||||
|
||||
|
||||
System.out.println("dashboard and menu inserted...");
|
||||
|
||||
|
||||
@ -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.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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
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.Basicp3;
|
||||
|
||||
|
||||
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/Basicp3_insert")
|
||||
public Basicp3 insertBasicp3(@RequestBody Basicp3 data) {
|
||||
Basicp3 insertaction = Service.insertBasicp3(data);
|
||||
return insertaction;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Ad7/Support_insert")
|
||||
public Support insertSupport(@RequestBody Support data) {
|
||||
Support insertaction = Service.insertSupport(data);
|
||||
return insertaction;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
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;
|
||||
|
||||
|
||||
import com.realnet.stpkg.Entity.Childform;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PutMapping("/Ad8/Childform_update/{id}")
|
||||
public ResponseEntity<?> updateChildform(@PathVariable Integer id, @RequestBody Childform data) {
|
||||
ResponseEntity<?> update = Service.updateChildform(id, data);
|
||||
System.out.println(update + " updateed");
|
||||
return update;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
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.Adv1;
|
||||
import com.realnet.angulardatatype.Services.Adv1Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Adv1")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Adv1Controller {
|
||||
@Autowired
|
||||
private Adv1Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Adv1")
|
||||
public Adv1 Savedata(@RequestBody Adv1 data) {
|
||||
Adv1 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Adv1/{id}")
|
||||
public Adv1 update(@RequestBody Adv1 data,@PathVariable Integer id ) {
|
||||
Adv1 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Adv1/getall/page")
|
||||
public Page<Adv1> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Adv1> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Adv1")
|
||||
public List<Adv1> getdetails() {
|
||||
List<Adv1> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Adv1")
|
||||
public List<Adv1> getallwioutsec() {
|
||||
List<Adv1> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Adv1/{id}")
|
||||
public Adv1 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Adv1 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Adv1/{id}")
|
||||
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
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.Basicp1;
|
||||
import com.realnet.angulardatatype.Services.Basicp1Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Basicp1")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Basicp1Controller {
|
||||
@Autowired
|
||||
private Basicp1Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Basicp1")
|
||||
public Basicp1 Savedata(@RequestBody Basicp1 data) {
|
||||
Basicp1 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Basicp1/{id}")
|
||||
public Basicp1 update(@RequestBody Basicp1 data,@PathVariable Integer id ) {
|
||||
Basicp1 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Basicp1/getall/page")
|
||||
public Page<Basicp1> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Basicp1> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Basicp1")
|
||||
public List<Basicp1> getdetails() {
|
||||
List<Basicp1> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Basicp1")
|
||||
public List<Basicp1> getallwioutsec() {
|
||||
List<Basicp1> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Basicp1/{id}")
|
||||
public Basicp1 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Basicp1 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Basicp1/{id}")
|
||||
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
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.Basicp2;
|
||||
import com.realnet.angulardatatype.Services.Basicp2Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Basicp2")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Basicp2Controller {
|
||||
@Autowired
|
||||
private Basicp2Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Basicp2")
|
||||
public Basicp2 Savedata(@RequestBody Basicp2 data) {
|
||||
Basicp2 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Basicp2/{id}")
|
||||
public Basicp2 update(@RequestBody Basicp2 data,@PathVariable Integer id ) {
|
||||
Basicp2 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Basicp2/getall/page")
|
||||
public Page<Basicp2> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Basicp2> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Basicp2")
|
||||
public List<Basicp2> getdetails() {
|
||||
List<Basicp2> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Basicp2")
|
||||
public List<Basicp2> getallwioutsec() {
|
||||
List<Basicp2> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Basicp2/{id}")
|
||||
public Basicp2 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Basicp2 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Basicp2/{id}")
|
||||
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -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.Basicp3;
|
||||
import com.realnet.angulardatatype.Services.Basicp3Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Basicp3")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Basicp3Controller {
|
||||
@Autowired
|
||||
private Basicp3Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Basicp3")
|
||||
public Basicp3 Savedata(@RequestBody Basicp3 data) {
|
||||
Basicp3 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Basicp3/{id}")
|
||||
public Basicp3 update(@RequestBody Basicp3 data,@PathVariable Integer id ) {
|
||||
Basicp3 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Basicp3/getall/page")
|
||||
public Page<Basicp3> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Basicp3> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Basicp3")
|
||||
public List<Basicp3> getdetails() {
|
||||
List<Basicp3> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Basicp3")
|
||||
public List<Basicp3> getallwioutsec() {
|
||||
List<Basicp3> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Basicp3/{id}")
|
||||
public Basicp3 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Basicp3 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Basicp3/{id}")
|
||||
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user