diff --git a/frontend/angular-clarity-master/src/app/models/fnd/apiregisteryline.ts b/frontend/angular-clarity-master/src/app/models/fnd/apiregisteryline.ts new file mode 100644 index 0000000..5db740a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/apiregisteryline.ts @@ -0,0 +1,10 @@ +export class ApiRegisteryLine { + public id: number; + public url: string; + public method: string; + public header_id: number; + + + + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/FileUploadList.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/FileUploadList.component.ts new file mode 100644 index 0000000..c2c2a45 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/FileUploadList.component.ts @@ -0,0 +1,23 @@ +// import { Component, Input, Output, EventEmitter } from '@angular/core'; + +// @Component({ +// selector: 'app-file-upload-list', +// templateUrl: './file-upload-list.component.html', +// }) +// export class FileUploadListComponent { +// @Input() fileData: any[] = []; +// @Input() type: 'image' | 'audio' | 'video' | 'document' = 'image'; +// @Output() fileChanged = new EventEmitter<{ event: any, index: number }>(); +// @Output() deleteRow = new EventEmitter(); +// @Output() addRow = new EventEmitter(); + +// get acceptType() { +// switch (this.type) { +// case 'image': return 'image/*'; +// case 'audio': return 'audio/*'; +// case 'video': return 'video/*'; +// case 'document': return 'application/pdf,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel'; +// default: return '*/*'; +// } +// } +// } diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/file-upload-list.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/file-upload-list.component.html new file mode 100644 index 0000000..2fe6e1b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/file-upload-list.component.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts index 5e6d93b..802a5e6 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts @@ -34,7 +34,7 @@ export class DatamanagementComponent implements OnInit { ngOnInit(): void { this.getall(); - this.getuserall(); + // this.getuserall(); this.allentity(); this.entitygetall(); this.entryForm = this._fb.group({ diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.html new file mode 100644 index 0000000..b29b64e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.html @@ -0,0 +1,354 @@ + +
+
+
+

Token registery

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + token name + + + + token + + + + + + Action + + + + + + {{user.token_name }} + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.scss @@ -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; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.ts new file mode 100644 index 0000000..9d0ecaf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.ts @@ -0,0 +1,251 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Token_registeryservice } from './Token_registery.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 { Token_registerycardvariable } from './Token_registery_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Token_registery', + templateUrl: './Token_registery.component.html', + styleUrls: ['./Token_registery.component.scss'] +}) +export class Token_registeryComponent implements OnInit { + cardButton = Token_registerycardvariable.cardButton; + cardmodeldata = Token_registerycardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Token_registerycardvariable.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 = 'Token_registery_formCode' + tableName = 'Token_registery'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Token_registeryservice, + 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({ + token_name: [null], + + token: [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 === "Token_registery_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(); + + } + + + rsModaltoken = false; + goToReplaceStringtoken(row) { + this.rowSelected = row; this.rsModaltoken = true; + } + + // updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.service.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.service.ts new file mode 100644 index 0000000..6fdf18c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.service.ts @@ -0,0 +1,38 @@ +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"; +@Injectable({ + providedIn: 'root' +}) +export class Token_registeryservice { + private baseURL = "apiregistery"; + + constructor( + + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL + "/getall"); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL + "/generateToken", data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/delete/" + id; + return this.apiRequest.delete(_http); + } + + + + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery_cardvariable.ts new file mode 100644 index 0000000..3062363 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery_cardvariable.ts @@ -0,0 +1,4 @@ +export const Token_registerycardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/ApiRegistery.service.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/ApiRegistery.service.ts new file mode 100644 index 0000000..21f04cb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/ApiRegistery.service.ts @@ -0,0 +1,46 @@ +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"; +@Injectable({ + providedIn: 'root' +}) +export class ApiRegisteryservice { + private baseURL = "Api_registery_header/Api_registery_header"; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.html new file mode 100644 index 0000000..e7e1514 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.html @@ -0,0 +1,382 @@ + +
+
+
+

ApiRegisteryLine

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + url + + + + method + + + + + + + + Action + + + + + + {{user.url }} + + + {{user.method }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.ts new file mode 100644 index 0000000..5b060a1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.ts @@ -0,0 +1,230 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Apiregisterylineservice } from './Apiregisteryline.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 { Apiregisterylinecardvariable } from './Apiregisteryline_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { ActivatedRoute } from '@angular/router'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Apiregisteryline', + templateUrl: './Apiregisteryline.component.html', + styleUrls: ['./Apiregisteryline.component.scss'] +}) +export class ApiregisterylineComponent implements OnInit { + cardButton = Apiregisterylinecardvariable.cardButton; + cardmodeldata = Apiregisterylinecardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Apiregisterylinecardvariable.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 = 'Apiregisteryline_formCode'; + headerId; + tableName = 'Apiregisteryline'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Apiregisterylineservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + private route: ActivatedRoute, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + + this.headerId = this.route.snapshot.params["id"]; + console.log("headerId = ", this.headerId); + + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + url: [null], + + method: [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 === "Apiregisteryline_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(this.headerId).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.entryForm.value.header_id = this.headerId; + 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 +} + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.service.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.service.ts new file mode 100644 index 0000000..d0d929c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.service.ts @@ -0,0 +1,38 @@ +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"; +@Injectable({ + providedIn: 'root' +}) +export class Apiregisterylineservice { + private baseURL = "Api_registery_line/Api_registery_line"; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(headerId: number, page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL + "/header/" + headerId); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline_cardvariable.ts new file mode 100644 index 0000000..d7b2860 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline_cardvariable.ts @@ -0,0 +1,4 @@ +export const Apiregisterylinecardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html index 5e77f4e..114e7d5 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html @@ -1,102 +1,172 @@ - -
-
-
-

API-Registery - {{getFormCode}}

-
-
- - - -
+
  • +
  • Super Admin
  • +
  • Form-Extension
  • + + +
    +
    +
    +

    API-Registery - {{getFormCode}}

    - - - Loading ... -
    {{error}}
    - - - - + Table Name - - - Action - - - - - - - {{user.field_name}} - - - - - - -
    Who Column
    -
    Account ID: {{user.accountId}}
    -
    Created At: {{user.createdAt| date}}
    -
    Created By: {{user.createdBy}}
    -
    Updated At: {{user.updatedAt | date}}
    -
    Updated By: {{user.updatedBy}}
    -
    -
    -
    - + + {{user.table_name}} + + + + + + +
    Who Column
    +
    Account ID: {{user.accountId}}
    +
    Created At: {{user.createdAt| date}}
    +
    Created By: {{user.createdBy}}
    +
    Updated At: {{user.updatedAt | date}}
    +
    Updated By: {{user.updatedBy}}
    +
    +
    + + + +
    + + + - - - - - - -
    Field Name: {{user.field_name}}
    -
    -
    - - - Users per page - {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} - of {{pagination.totalItems}} users - - -
    -
    - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts index 9d1a710..70425b0 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts @@ -1,31 +1,18 @@ -// import { Component } from '@angular/core'; -// @Component({ -// selector: 'app-allapiregistery', -// templateUrl: './allapiregistery.component.html', -// styleUrls: ['./allapiregistery.component.scss'] -// }) -// export class AllapiregisteryComponent { - -// } import { Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core'; import { ActivatedRoute, Router } from "@angular/router"; import { ToastrService } from 'ngx-toastr'; import { ExtensionField } from "src/app/models/fnd/ExtensionField"; import { ExtensionService } from 'src/app/services/fnd/extension.service'; -import { ApiregisteryService } from 'src/app/services/fnd/apiregistery.service'; //import { Teacher } from "src/app/pages/university/teacher/Teacher"; import { UserInfoService } from "src/app/services/user-info.service"; -import { ApiRegisteryLine } from 'src/app/models/fnd/apiregisteryline'; +import { ApiRegisteryservice } from '../ApiRegistery.service'; +import { FormBuilder, FormGroup } from '@angular/forms'; interface Rows { - // id: number; - // field_name: any; - // mapping: any; - // data_type: any; - // isActive: any; + id: number; url: string; method: string; @@ -43,26 +30,30 @@ export class AllapiregisteryComponent implements OnInit { //@ViewChild("filter") filter: ElementRef; basic: boolean = false; // whoColumns: Teacher; // who columns data - alldata:any; - + alldata: any; + userrole; columns: any[]; rows: Rows[]; temp = []; rowSelected: any = {}; modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; loading = false; error; selected: any[] = []; filterData: string; isLoading: boolean = false; extensionField: ExtensionField[] = []; - apiRegisteryLineData: ApiRegisteryLine[] = []; constructor(private router: Router, private route: ActivatedRoute, private toastr: ToastrService, private extensionService: ExtensionService, - private apiregistery: ApiregisteryService, - private userInfoService: UserInfoService) { } + private apiregistery: ApiRegisteryservice, + private userInfoService: UserInfoService, + private _fb: FormBuilder, + ) { } private account_id: any; // private formCode: any; @@ -89,50 +80,27 @@ export class AllapiregisteryComponent implements OnInit { // { prop: "data_type", name: "Data Type", width: 190 }, // /* { prop: "id", name: "Show In Grid", width: 90, cellTemplate: this.txId } */ // ]; + + this.entryForm = this._fb.group({ + table_name: [null], + }); + + this.userrole = this.userInfoService.getRoles(); + } - // getData() { - // this.isLoading = true; - // //this.extensionField = new ExtensionField(); - // this.apiregistery.getAll().subscribe((data) => { - // this.isLoading = false; - // console.log(data); - // // this.extensionField = data; - // if (this.formCode === 'undefined' || this.formCode === undefined || this.formCode === null) { - // this.extensionField = data; - // } else { - // this.extensionField = data.filter(item => item.form_code === this.formCode); - // console.log(this.extensionField); - // } - // this.rows = this.extensionField; - // if (this.extensionField.length == 0) { - // this.error = "No data Available"; - // console.log(this.error) - // } - // //this.temp = [...this.extensionField]; - // }, (error) => { - // console.log(error); - // if (error) { - // this.error = "No data Available OR server Error"; - // } - // }); - // } - - - - getData() { - this.apiregistery.getAll().subscribe((data)=>{ - this.alldata=data - console.log(this.alldata); - if(this.alldata.length==0){ - this.error="No data Available"; - console.log(this.error) - } - },(error) => { + this.apiregistery.getAll().subscribe((data) => { + this.alldata = data + console.log(' get all ', this.alldata); + if (this.alldata.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { console.log(error); - if(error){ - this.error="Server Error"; - } + if (error) { + this.error = "Server Error"; + } }) } @@ -170,7 +138,7 @@ export class AllapiregisteryComponent implements OnInit { // this.toastr.success("Build successfully"); // } - + // }, // (err) => { @@ -211,12 +179,94 @@ export class AllapiregisteryComponent implements OnInit { // //this.extensionService.update(id,this.extField).subscribe(); // } - goToAdd() { - this.router.navigate(["../add"], { relativeTo: this.route }); + goToEdit(row) { + this.rowSelected = row; + + this.modalEdit = true; } - goToEdit(id: number) { - this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + + onUpdate(id) { + this.modalEdit = false; + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.apiregistery.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.apiregistery.create(this.entryForm.value).subscribe( + (data) => { + console.log('after add ', 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(); + + } + + + // goToAdd() { + // this.router.navigate(["../add"], { relativeTo: this.route }); + // } + // goToEdit(id: number) { + // this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + // } goToWhoColumns(id: number) { this.basic = !this.basic; @@ -241,4 +291,9 @@ export class AllapiregisteryComponent implements OnInit { } }); } + + + gotoline(id: any) { + this.router.navigate(["../line/" + id], { relativeTo: this.route }) + } } diff --git a/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts index 0b8deee..6bd5436 100644 --- a/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts +++ b/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts @@ -10,9 +10,9 @@ import { map } from 'rxjs/operators'; }) export class DatamanagementService { private URL = environment.backendUrl; -private updateUrl="api/template/dynamic/dynamic_temp" - constructor( private apiRequest: ApiRequestService,private _http: HttpClient) { } - getall(){ + private updateUrl = "api/template/dynamic/dynamic_temp" + constructor(private apiRequest: ApiRequestService, private _http: HttpClient) { } + getall() { return this.apiRequest.get(`api/template/getalltemplate`); } @@ -43,68 +43,68 @@ private updateUrl="api/template/dynamic/dynamic_temp" // return this.apiRequest.postFormData(`sureserve/template/dynamic/dynamic_temp`,formData); // } - + create(file: any, fileType: string): Observable { const formData: FormData = new FormData(); formData.append('file', file); - // let params: HttpParams = new HttpParams(); - // params =params.append('fileType', fileType); + // let params: HttpParams = new HttpParams(); + // params =params.append('fileType', fileType); return this.apiRequest.postFormData(`api/template/save/${fileType}`, formData); } - - update(id: number, data:any,files:any): Observable { - const s =JSON.stringify(data); - const formData:FormData=new FormData(); - formData.append("data",s); - formData.append("file",files); - return this.apiRequest.postFormData(`${this.updateUrl}/${id}`,formData); + + update(id: number, data: any, files: any): Observable { + const s = JSON.stringify(data); + const formData: FormData = new FormData(); + formData.append("data", s); + formData.append("file", files); + return this.apiRequest.postFormData(`${this.updateUrl}/${id}`, formData); } - - delete(id:any){ + + delete(id: any) { return this.apiRequest.delete(`api/template/deletetemplate/${id}`); } // getjson(){ // return this.apiRequest.get(`api/dynamic/jsonkeychange`); // } - - changeKeysOfJson(newjson: string, body:any): Observable { + + changeKeysOfJson(newjson: string, body: any): Observable { // const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded'); // let params: HttpParams = new HttpParams(); // params =params.append('newjson', newJson); // params =params.append('body', body); - const formData:FormData=new FormData(); - formData.append("newjson",newjson); - formData.append("body",body); + const formData: FormData = new FormData(); + formData.append("newjson", newjson); + formData.append("body", body); return this.apiRequest.postFormData(`api/dynamic/jsonkeychange`, formData); } - - -saveTemplateInJson(id: any): Observable { - // const formData: FormData = new FormData(); - // formData.append('file', file); - // console.log(formData, file); - - // let params: HttpParams = new HttpParams(); - // params =params.append("file",file); - return this.apiRequest.get(`api/dynamic/templatetojson/${id}`); -} - -convertFileToJson(id: number): Observable { - return this.apiRequest.post(`api/dynamic/templatetojson/${id}`, {}); -} -downloadExcel(tableName: string, data:any): Observable { - // return this.apiRequest.post(`api/dynamic/DownloadExcel/${tableName}`, data); - const url = `${this.URL}/api/dynamic/DownloadExcel/${tableName}`; - return this._http.post(url, data, { responseType: 'blob' }).pipe( - map((response: Blob) => { - // Process the response as needed - return response; - }) - ); -} + saveTemplateInJson(id: any): Observable { + // const formData: FormData = new FormData(); + // formData.append('file', file); + // console.log(formData, file); + + // let params: HttpParams = new HttpParams(); + // params =params.append("file",file); + return this.apiRequest.get(`api/dynamic/templatetojson/${id}`); + } + + convertFileToJson(id: number): Observable { + return this.apiRequest.post(`api/dynamic/templatetojson/${id}`, {}); + } + + + downloadExcel(tableName: string, data: any): Observable { + // return this.apiRequest.post(`api/dynamic/DownloadExcel/${tableName}`, data); + const url = `${this.URL}/api/dynamic/DownloadExcel/${tableName}`; + return this._http.post(url, data, { responseType: 'blob' }).pipe( + map((response: Blob) => { + // Process the response as needed + return response; + }) + ); + } diff --git a/frontend/angular-clarity-master/src/assets/i18n/en.json b/frontend/angular-clarity-master/src/assets/i18n/en.json index ee15955..0b299c4 100644 --- a/frontend/angular-clarity-master/src/assets/i18n/en.json +++ b/frontend/angular-clarity-master/src/assets/i18n/en.json @@ -226,10 +226,150 @@ "MENU_ACTION_LINK": "Menu Action Link", "STATUS": "Status", "SUB_MENU": "Sub Menu", - "Active": "Active", + "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", + "audio_Field2": "audio_Field2", + "QRCode_Field2": "QRCode_Field2", + "dylist": "dylist", + "Basicp3": "Basicp3", + "Basicp2": "Basicp2", + "stmlit": "stmlit", + "1ega": "1ega", + "Country": "Country", + "BarCode_Field2": "BarCode_Field2", + "Imageupload_Field": "Imageupload_Field", + "dy2": "dy2", + "name2": "name2", + "idfemale": "idfemale", + "dy1": "dy1", + "Url_Field2": "Url_Field2", + "t1": "t1", + "age2": "age2", + "t2": "t2", + "age1": "age1", + "Sum2": "Sum2", + "t4": "t4", + "Decimal_Field2": "Decimal_Field2", "Description": "Description", - "Fileupload_Field": "Fileupload_Field", - "Test22": "Test22", + "gender": "gender", + "select_Field": "select_Field", + "QRCode_Field": "QRCode_Field", + "Datetime_Field": "Datetime_Field", + "sum": "sum", + "test1": "test1", "Test11": "Test11", - "Name": "Name" + "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", + "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", + "Paragraph_Field": "Paragraph_Field", + "State": "State", + "district": "district", + "name": "name", + "UserId_Field": "UserId_Field", + "Email_Field2": "Email_Field2", + "Static": "Static", + "District": "District", + "about_yourself": "about_yourself", + "datagrid_Field2": "datagrid_Field2", + "Toggle_Switch2": "Toggle_Switch2", + "Dv2": "Dv2", + "Dynamic": "Dynamic", + "description": "description", + "number1": "number1", + "Phone_Number": "Phone_Number", + "Fileupload_Field": "Fileupload_Field", + "number2": "number2", + "Value_List_Field": "Value_List_Field", + "Value_List_Field2": "Value_List_Field2", + "district_name": "district_name", + "OneToOne": "OneToOne", + "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" } \ No newline at end of file