base_project
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AccesstypeService {
|
||||
private AllURL = 'access_type/Accesstype';
|
||||
private moduleurl='_back/Modules_t'
|
||||
constructor( private apiRequest: ApiRequestService,private _http: HttpClient,) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
return this.apiRequest.get(this.AllURL, params);
|
||||
}
|
||||
|
||||
create(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.AllURL, data);
|
||||
}
|
||||
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.AllURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.AllURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
getAll1(page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
return this.apiRequest.get(this.moduleurl, params);
|
||||
}
|
||||
|
||||
create1(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.moduleurl, data);
|
||||
}
|
||||
|
||||
delete1(id: number): Observable<any> {
|
||||
const _http = this.moduleurl + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
update1(id: number, data: any): Observable<any> {
|
||||
const _http = this.moduleurl + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
public getById(id: any){
|
||||
return this._http.get(`${baseUrl}/access_type/accessmenu/Accessmenu/${id}`);
|
||||
}
|
||||
public addById(id:any,data:any){
|
||||
return this._http.post(`${baseUrl}/access_type/accessmenu/Accessmenu/${id}`,data);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuditreportService {
|
||||
private dateurl="audit/betweendate";
|
||||
constructor(private _http: HttpClient,private apiRequest: ApiRequestService,) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/audit/auditall`);
|
||||
}
|
||||
public getbyid(id:any) {
|
||||
return this._http.get(`${baseUrl}/audit/auditall/${id}`);
|
||||
}
|
||||
public getbyuser(val:any){
|
||||
return this._http.get(`${baseUrl}/audit/listusername/${val}`);
|
||||
}
|
||||
public getbyentity(val:any){
|
||||
return this._http.get(`${baseUrl}/audit/listentityname/${val}`);
|
||||
}
|
||||
public onlydate(from:any,to:any){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("startDate",from);
|
||||
params =params.append("endDate",to);
|
||||
return this.apiRequest.get(this.dateurl,params);
|
||||
}
|
||||
public apply(from:any,to:any,user:any,entity:any){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("startDate",from);
|
||||
params =params.append("endDate",to);
|
||||
params =params.append("user",user);
|
||||
params =params.append("entity_name",entity)
|
||||
return this.apiRequest.get(`audit/betweendate_byuser`,params);
|
||||
//return this._http.get(`${baseUrl}/audit/betweendate_byuser/${from}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ConnectorMappingService {
|
||||
private getAllData = 'connector/Connectorjson';
|
||||
private baseURL = 'Connectorjson';
|
||||
|
||||
constructor(private _http: HttpClient,) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/connector/Connectorjson`);
|
||||
}
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/connector/Connectorjson`, data);
|
||||
}
|
||||
public getById(id: any){
|
||||
return this._http.get(`${baseUrl}/connector/Connectorjson/${id}`);
|
||||
}
|
||||
public delete(id:any){
|
||||
return this._http.delete(`${baseUrl}/connector/Connectorjson/${id}`);
|
||||
}
|
||||
public getkeys(data:any) {
|
||||
return this._http.post(`${baseUrl}/token/connector/mapping/mapping`,data);
|
||||
}
|
||||
public getValues(data:any) {
|
||||
return this._http.post(`${baseUrl}/token/connector/mapping/mapping1`,data);
|
||||
}
|
||||
public getValues1(data:any) {
|
||||
return this._http.post(`${baseUrl}/token/connector/mapping/mapping2`,data);
|
||||
}
|
||||
public update(id:any,data:any){
|
||||
return this._http.put(`${baseUrl}/connector/Connectorjson/${id}`, data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http";
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DeploymentprofileService {
|
||||
|
||||
private getAllURL = 'deployment/deplomentprofile';
|
||||
addDataURl = 'deployment/deplomentprofile';
|
||||
private baseURL = "deployment/deplomentprofile";
|
||||
private getallline="deployment/deplomentprofile_line";
|
||||
constructor(
|
||||
private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService
|
||||
) { }
|
||||
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
return this.apiRequest.get(this.getAllURL, params);
|
||||
}
|
||||
getalllines(page?: number, size?: number){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
return this.apiRequest.get(this.getallline,params);
|
||||
}
|
||||
create(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
update(id: number, data: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import{environment} from 'src/environments/environment';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { HealthCheckup } from 'src/app/models/fnd/health_checkup';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HealthCheckupService {
|
||||
|
||||
baseUrl = 'HealthCheckup'
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService) { }
|
||||
|
||||
getHealthCheckups(): Observable<HealthCheckup[]> {
|
||||
return this.apiRequest.get(`${this.baseUrl}/HealthCheckup`);
|
||||
}
|
||||
|
||||
getHealthCheckupById(id: number): Observable<HealthCheckup> {
|
||||
return this.apiRequest.get(`${this.baseUrl}/HealthCheckup/${id}`);
|
||||
}
|
||||
|
||||
saveHealthCheckup(data: string, files: File[]): Observable<any> {
|
||||
const formData: FormData = new FormData();
|
||||
formData.append('data', JSON.stringify(data));
|
||||
|
||||
if (files && files.length > 0) {
|
||||
// console.log("if Condition",files);
|
||||
// for (const file of files) {
|
||||
// console.log("if Condition",file);
|
||||
// formData.append('files', file, file.name);
|
||||
// }
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
formData.append('files', files[i]);
|
||||
console.log("if Condition",files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return this.apiRequest.postFormData(`${this.baseUrl}/HealthCheckup`, formData);
|
||||
}
|
||||
|
||||
updateHealthCheckup(id: number, data: HealthCheckup): Observable<HealthCheckup> {
|
||||
return this.apiRequest.put(`${this.baseUrl}/HealthCheckup/${id}`, data);
|
||||
}
|
||||
|
||||
deleteHealthCheckup(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`${this.baseUrl}/HealthCheckup/${id}`);
|
||||
}
|
||||
|
||||
//redeploy
|
||||
public getFileContent(healthId: number): Observable<any> {
|
||||
console.log(healthId)
|
||||
const url = `HealthCheckupfile/readeploy/${healthId}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
//files
|
||||
|
||||
getAllHealthCheckupFiles(healthId: number): Observable<any> {
|
||||
return this.apiRequest.get(`HealthCheckupfile/HealthCheckupfile/${healthId}`);
|
||||
}
|
||||
|
||||
readFile(fileId: number): Observable<any> {
|
||||
return this.apiRequest.get(`HealthCheckupfile/readfile/${fileId}`);
|
||||
}
|
||||
|
||||
//checkup
|
||||
getHealthCheckup(jobtype: string): Observable<any> {
|
||||
const url = `${this.baseUrl}/healthcheckup?jobtype=${jobtype}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LogconfigService {
|
||||
|
||||
constructor(private _http: HttpClient,) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/log/getAll`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this._http.get(`${baseUrl}/log/getOne/${Id}`);
|
||||
}
|
||||
public create(username:any,mode:any){
|
||||
return this._http.get(`${baseUrl}/log/startLogging/${username}/${mode}`);
|
||||
}
|
||||
public delete(username:any){
|
||||
return this._http.get(`${baseUrl}/log/stopLogging/${username}`);
|
||||
}
|
||||
public downloadfile(filename:any){
|
||||
return this._http.get(`${baseUrl}/log/downloadLog/${filename}`);
|
||||
}
|
||||
public readfile(id:any){
|
||||
return this._http.get(`${baseUrl}/log2/fileread/${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from '../../services/api/helper';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { Rn_Main_Menu } from '../../models/builder/Rn_Main_Menu';
|
||||
import { Observable } from 'rxjs';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MenuGroupService {
|
||||
public key: string ='key-for-data-in-cookies';
|
||||
private storage: Storage = sessionStorage;
|
||||
constructor(
|
||||
private _http: HttpClient,private readonly _cookieService: CookieService,
|
||||
private apiRequest: ApiRequestService,
|
||||
) { }
|
||||
|
||||
public getAll(){
|
||||
return this._http.get(`${baseUrl}/api/menu-group`);
|
||||
}
|
||||
|
||||
public addToDb(header: any){
|
||||
return this._http.post(`${baseUrl}/api/menu-group`, header);
|
||||
}
|
||||
|
||||
public addLineToDb(line: any){
|
||||
return this._http.post(`${baseUrl}/lines_m/create`, line);
|
||||
}
|
||||
|
||||
public getOneById(id: any){
|
||||
return this._http.get(`${baseUrl}/api/menu-group/${id}`);
|
||||
}
|
||||
|
||||
public updateGroupHeader(id: any, data: any){
|
||||
return this._http.put(`${baseUrl}/api/menu-group/${id}`, data);
|
||||
}
|
||||
|
||||
public updateLineById(id: any){
|
||||
return this._http.put(`${baseUrl}/lines_m/update`, id);
|
||||
}
|
||||
|
||||
public deleteById(id: any){
|
||||
return this._http.delete(`${baseUrl}/api/menu-group/${id}`);
|
||||
}
|
||||
getByCurrentUserMenuGroupId(): Observable<Rn_Main_Menu[]> {
|
||||
const _http1 = "api1/getByUserId"
|
||||
return this.apiRequest.get(_http1);
|
||||
}
|
||||
getByCurrentUserMenuGroupId1(): Observable<Rn_Main_Menu[]> {
|
||||
const _http1 = "api1/submenu1"
|
||||
return this.apiRequest.get(_http1);
|
||||
}
|
||||
getByCurrentUserMenuGroupId2(): Observable<Rn_Main_Menu[]> {
|
||||
const _http1 = "fndMenu/menuloadbyuser"//9292/fndMenu/menuloadbyuser
|
||||
return this.apiRequest.get(_http1);
|
||||
}
|
||||
private data: string = "data";
|
||||
public storeaddeditvalues(data:any,) {
|
||||
this.storage.setItem(this.data,JSON.stringify (data));
|
||||
console.log(this.data);
|
||||
}
|
||||
getdata(): any {
|
||||
//console.log(this.data);
|
||||
var data = JSON.parse(this.storage.getItem(this.data));
|
||||
//let data = this.storage.getItem(this.data);
|
||||
return data;
|
||||
}
|
||||
getuser(id:any){
|
||||
const http="chat/getuser";
|
||||
return this.apiRequest.post(http,id);
|
||||
}
|
||||
public save(text:string):void{
|
||||
return this._cookieService.set(this.key,text);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from '../../services/api/helper';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MenuRegisterService {
|
||||
|
||||
constructor(
|
||||
private _http: HttpClient
|
||||
) { }
|
||||
|
||||
public add(r: any){
|
||||
return this._http.post(`${baseUrl}/api/menu-register`, r);
|
||||
}
|
||||
|
||||
public getd(){
|
||||
return this._http.get(`${baseUrl}/api/menu-register`);
|
||||
}
|
||||
|
||||
public getById(id: any){
|
||||
return this._http.get(`${baseUrl}/api/menu-register/${id}`);
|
||||
}
|
||||
|
||||
public update(id:any, reg:any){
|
||||
return this._http.put(`${baseUrl}/api/menu-register/${id}`, reg);
|
||||
}
|
||||
|
||||
public deleteById(id: any){
|
||||
return this._http.delete(`${baseUrl}/api/menu-register/${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import baseUrl from '../../services/api/helper';
|
||||
import { Observable } from "rxjs";
|
||||
import { Rn_Main_Menu } from "../../models/builder/Rn_Main_Menu";
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MenumaintanceService {
|
||||
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService,) { }
|
||||
// create
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/Menu_maintain`, data);
|
||||
}
|
||||
|
||||
// update
|
||||
public update(id:number,data:any): Observable<any>{
|
||||
//const _http = this.baseURL + "/" + id;
|
||||
//return this.apiRequest.put(_http, data);
|
||||
return this._http.put(`${baseUrl}/Menu_maintain/${id}`, data);
|
||||
}
|
||||
// get all
|
||||
public getAll(){
|
||||
return this._http.get(`${baseUrl}/Menu_maintain`);
|
||||
}
|
||||
getByCurrentUserMenuGroupId1(): Observable<Rn_Main_Menu[]> {
|
||||
const _http1 = "api1/submenu1"
|
||||
return this.apiRequest.get(_http1);
|
||||
}
|
||||
// add submenudet table
|
||||
// create
|
||||
public create1(data: any){
|
||||
return this._http.post(`${baseUrl}/api1/Sec_menuDet`, data);
|
||||
}
|
||||
public create2(data:any){
|
||||
return this._http.post(`${baseUrl}/api1/addgrpwithsubmenu`, data)
|
||||
}
|
||||
// sink
|
||||
public sink(id:any,data:any){
|
||||
return this._http.put(`${baseUrl}/fndMenu/sink/${id}`,data);
|
||||
}
|
||||
//get by menuid->submenu
|
||||
public getbyid(id:any){
|
||||
return this._http.get(`${baseUrl}/api1/submenu1/${id}`);
|
||||
}
|
||||
//update update by menu_item_id
|
||||
public update1(id:number,data:any): Observable<any>{
|
||||
return this._http.put(`${baseUrl}/api1/submenu1/${id}`, data);
|
||||
}
|
||||
public update2(id:number,usrgrp:any,data:any): Observable<any>{
|
||||
return this._http.put(`${baseUrl}/api1/update/${id}/${usrgrp}`, data);
|
||||
}
|
||||
//delete
|
||||
public delete1(id: any){
|
||||
return this._http.delete(`${baseUrl}/api1/menu/${id}`);
|
||||
}
|
||||
// get one
|
||||
public getOne(Id: any){
|
||||
return this._http.get(`${baseUrl}/Menu_maintain/${Id}`);
|
||||
}
|
||||
|
||||
// delete
|
||||
public delete(id: any){
|
||||
return this._http.delete(`${baseUrl}/Menu_maintain/${id}`);
|
||||
}
|
||||
|
||||
public getLatestMenu(menuItemId: number, moduleName: string, mainMenuActionName: string) {
|
||||
return this._http.get(`${baseUrl}/api1/latest?menuItemId=${menuItemId}&moduleName=${moduleName}&mainMenuActionName=${mainMenuActionName}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import baseUrl from '../../services/api/helper';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MyworkspaceService {
|
||||
public localStorage: Storage = localStorage;
|
||||
constructor(private _http: HttpClient) { }
|
||||
public add(r: any){
|
||||
return this._http.post(`${baseUrl}/api/menu-register`, r);
|
||||
}
|
||||
|
||||
public getall(){
|
||||
return this._http.get(`${baseUrl}/Workspace_team/SecTeam`);
|
||||
}
|
||||
public getalluser(){
|
||||
return this._http.get(`${baseUrl}/User_workSpace/GetAllUser`);
|
||||
}
|
||||
public getallguest(){
|
||||
return this._http.get(`${baseUrl}/User_workSpace/GetAllGuest`);
|
||||
}
|
||||
public adduser(email:any){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("email", email);
|
||||
return this._http.post(`${baseUrl}/api/userviaadmin`,params);
|
||||
}
|
||||
storeEmail(email: string) {
|
||||
this.localStorage.setItem("registeredEmail", email);
|
||||
}
|
||||
//Store userinfo from session storage
|
||||
|
||||
//Get email from session storage ( WILL REMOVE AFTER REGISTER)
|
||||
getStoredEmail(): string | null {
|
||||
try {
|
||||
let email: string = this.localStorage.getItem(
|
||||
"registeredEmail"
|
||||
);
|
||||
if (email) {
|
||||
return email;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
adduserdetails(data:any,token:any){
|
||||
return this._http.post(`${baseUrl}/api/admin/adduser/${token}`,data);
|
||||
}
|
||||
|
||||
addguest(email:any,duration:any){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("email", email);
|
||||
params=params.append("access_duration",duration)
|
||||
return this._http.post(`${baseUrl}/api/guest_via_admin`,params);
|
||||
}
|
||||
|
||||
addguestdetails(data:any,token:any){
|
||||
return this._http.post(`${baseUrl}/api/admin/addguest/${token}`,data);
|
||||
}
|
||||
addteam(data:any){
|
||||
return this._http.post(`${baseUrl}/Workspace_team/SecTeam`,data);
|
||||
}
|
||||
public getallteammeme(id:any){
|
||||
return this._http.get(`${baseUrl}/User_workSpace/GetAllMember/${id}`);
|
||||
}
|
||||
getallusertosameaccid(){
|
||||
return this._http.get(`${baseUrl}/User_workSpace/GetAll`);
|
||||
}
|
||||
addteammem(id:any,user_id:any,data:any){
|
||||
return this._http.post(`${baseUrl}/User_workSpace/add_team/${id}/${user_id}`,data);
|
||||
}
|
||||
getallworkspace(){
|
||||
return this._http.get(`${baseUrl}/Workspace_workspace/FindByaccount`);
|
||||
}
|
||||
addsecworkspaceuser(usrid:any,id:any,data:any,){
|
||||
return this._http.post(`${baseUrl}/workspace/secworkspaceuser/add_workspace/users/${usrid}/${id}`,data);
|
||||
}
|
||||
addsecworkteam(pid:any,tid:any,data:any){
|
||||
return this._http.post(`${baseUrl}/workspace/secworkspaceuser/addteam/${pid}/${tid}`,data);
|
||||
}
|
||||
getallsecworkspace(id:any){
|
||||
return this._http.get(`${baseUrl}/workspace/secworkspaceuser/get_by_projectid/${id}`);
|
||||
}
|
||||
// public getById(id: any){
|
||||
// return this._http.get(`${baseUrl}/api/menu-register/${id}`);
|
||||
// }
|
||||
|
||||
// public update(id:any, reg:any){
|
||||
// return this._http.put(`${baseUrl}/api/menu-register/${id}`, reg);
|
||||
// }
|
||||
|
||||
// public deleteById(id: any){
|
||||
// return this._http.delete(`${baseUrl}/api/menu-register/${id}`);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class OutgoingwebhookService {
|
||||
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
getall(){
|
||||
let _http = `api/outgoing/getall`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
getallentity(){
|
||||
let _http = `api/outgoing/getentity`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
wall(){
|
||||
let _http = `api/webhookdata/getall`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
post(data:any){
|
||||
let _http=`api/outgoing/save`;
|
||||
return this.apiRequest.post(_http,data);
|
||||
}
|
||||
getById(id: number) {
|
||||
const _http =`api/outgoing/getById/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
update(id: number, data:any): Observable<any> {
|
||||
const _http =`api/outgoing/update/${id}`;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
update1(id: number, data:any): Observable<any> {
|
||||
const _http =`api/outgoing_lines/update/${id}`;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
delete(id:any){
|
||||
let _http=`api/outgoing/delete/${id}`;
|
||||
return this.apiRequest.delete(_http,);
|
||||
}
|
||||
getallworkflow(){
|
||||
let _http = `token/webhook/Workflow/getall`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
getbyidworkflow(id:any){
|
||||
let _http = `token/webhook/Workflow/get/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SessionloggerService {
|
||||
|
||||
constructor(private _http: HttpClient) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/user1/session/getAll`);
|
||||
}
|
||||
|
||||
public delete(id:any){
|
||||
return this._http.delete(`${baseUrl}/user1/session/delete/${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
//import baseUrl from 'src/app/services/api/helper';
|
||||
import { environment } from 'src/environments/environment';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SureConnectorService {
|
||||
baseurl = environment.jobmgurl;
|
||||
constructor(private _http: HttpClient,) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${this.baseurl}/jobpro/get_rn_sureconnetor`);
|
||||
}
|
||||
public create(data: any){
|
||||
return this._http.post(`${this.baseurl}/jobpro/Savern_sureconnetor`, data);
|
||||
}
|
||||
|
||||
public delete(id:any){
|
||||
return this._http.delete(`${this.baseurl}/jobpro/delete_by_rn_sureconnetor_id/${id}`);
|
||||
}
|
||||
|
||||
public update(id:any,data:any){
|
||||
return this._http.put(`${this.baseurl}/jobpro/update_rn_sureconnetor/${id}`, data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SureOpsscriptmasterService {
|
||||
private URL = 'Sureops_script_api/Sureops_script_apis';
|
||||
private url='Sureops_script_api/Sureops_script_line'
|
||||
private masterurl='Sureops_script_master/sureops_scriptmaster1'
|
||||
constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
// params = params.append("module_id", module_id.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.URL, params);
|
||||
}
|
||||
|
||||
create(data:any): Observable<any>{
|
||||
return this.apiRequest.post(this.URL, data);
|
||||
}
|
||||
|
||||
delete(id:number){
|
||||
let _http = this.URL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
getById(id:number)
|
||||
{
|
||||
let _http = this.URL + "/"+id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
updateLineById(id:number,data:any)
|
||||
{
|
||||
let _http = this.url + "/"+id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
|
||||
update(id:number,data:any)
|
||||
{
|
||||
let _http = this.URL + "/"+id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
|
||||
getall(page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
// params = params.append("module_id", module_id.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.masterurl, params);
|
||||
}
|
||||
|
||||
create1(data:any): Observable<any>{
|
||||
return this.apiRequest.post(this.masterurl, data);
|
||||
}
|
||||
|
||||
delete1(id:number){
|
||||
let _http = this.masterurl + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
getById1(id:number)
|
||||
{
|
||||
let _http = this.masterurl + "/"+id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
update1(id:number,data:any)
|
||||
{
|
||||
let _http = this.masterurl + "/"+id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SureapiService {
|
||||
url='sure_connect/sure_postman/call_api'
|
||||
constructor(private http:HttpClient,private apiRequest: ApiRequestService,) { }
|
||||
createpostman(api_url:any,json_body:any,method: any,token:any){
|
||||
console.log(api_url,json_body,method,token)
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("api_url",api_url);
|
||||
// params =params.append("json_body",json_body);
|
||||
params =params.append("method",method);
|
||||
params =params.append("token",token)
|
||||
return this.http.post(`${baseUrl}/sure_connect/sure_postman/call_api`,json_body,{params:params});
|
||||
//return this.apiRequest.post(this.url,{ search:params });
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SureconnectService {
|
||||
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService,) { }
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/Sure_Connect`, data);
|
||||
}
|
||||
|
||||
// create card
|
||||
public update(data: any,id:any){
|
||||
return this._http.put(`${baseUrl}/Sure_Connect/${id}`, data);
|
||||
}
|
||||
|
||||
// get all cards
|
||||
public getAll(){
|
||||
return this._http.get(`${baseUrl}/Sure_Connect`);
|
||||
}
|
||||
|
||||
// get one card
|
||||
public getOne(id: any){
|
||||
return this._http.get(`${baseUrl}/Sure_Connect/${id}`);
|
||||
}
|
||||
|
||||
// delete card
|
||||
public delete(id: any){
|
||||
return this._http.delete(`${baseUrl}/Sure_Connect/${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SysparameterService {
|
||||
private addsysurl = 'sysparam/addSysParams ';
|
||||
private updatesysurl = 'sysparam/updateSysParams';
|
||||
private getbyidurl = 'sysparam/getSysParams';
|
||||
constructor(private apiRequest: ApiRequestService,) { }
|
||||
|
||||
|
||||
create(data: any): Observable<any> {
|
||||
return this.apiRequest.post(this.addsysurl, data);
|
||||
}
|
||||
|
||||
update(id: number, data: any, file: any): Observable<any> {
|
||||
const s = JSON.stringify(data);
|
||||
const formData: FormData = new FormData();
|
||||
formData.append("o1", s);
|
||||
formData.append(file.name, file);
|
||||
|
||||
const _http = this.updatesysurl + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.getbyidurl + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
import { university } from "../../models/fnd/university";
|
||||
import { Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
import { UserInfoService } from "../user-info.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UniversityService {
|
||||
|
||||
private baseURL = "api/author";
|
||||
constructor(
|
||||
private apiRequest: ApiRequestService,
|
||||
private userInfoService: UserInfoService
|
||||
) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
console.log(this.userInfoService.getUserInfo().userId);
|
||||
let id = this.userInfoService.getUserInfo().userId;
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
getById(id: number): Observable<university> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
create(college: university): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, college);
|
||||
}
|
||||
|
||||
update(id: number, projectSetup: university): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, projectSetup);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from '../../services/api/helper';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserListService {
|
||||
|
||||
constructor(
|
||||
private _http: HttpClient
|
||||
) { }
|
||||
|
||||
public add(user: any){
|
||||
return this._http.post(`${baseUrl}/user_list/create`, user);
|
||||
}
|
||||
|
||||
public update(user: any){
|
||||
return this._http.put(`${baseUrl}/user_list/update`, user);
|
||||
}
|
||||
|
||||
public getOne(user: any){
|
||||
return this._http.get(`${baseUrl}/user_list/get-one/${user}`);
|
||||
}
|
||||
|
||||
public getAll(){
|
||||
return this._http.get(`${baseUrl}/user_list/get-all`);
|
||||
}
|
||||
|
||||
public deleteById(id: any){
|
||||
return this._http.delete(`${baseUrl}/user_list/delete/${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AppConfig } from '../../app-config';
|
||||
import { Observable } from 'rxjs';
|
||||
import { UserInfoService } from '../user-info.service';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { TranslateService } from '../api/translate.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
export interface UserProfile {
|
||||
email: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
fullName: string;
|
||||
pronouns?: string;
|
||||
photos?: string;
|
||||
status?: string;
|
||||
role?: string;
|
||||
roles?: Role[];
|
||||
department?: string;
|
||||
about?: string;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
accountId?: number;
|
||||
createdBy?: number;
|
||||
updatedBy: number;
|
||||
|
||||
}
|
||||
export interface Role {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
@Injectable()
|
||||
export class UserProfileService {
|
||||
|
||||
private userProfileURL = 'api/user-profile';
|
||||
private postUserProfilePicURL = 'api/upload';
|
||||
private getUserProfilePicURL = 'api/retrieve-image';
|
||||
private userAcountURL = 'api/user-account';
|
||||
private aboutWork = 'token/aboutwork';
|
||||
|
||||
private getids = 'token/userid';
|
||||
|
||||
private actionBuilderURL="token/aboutwork"
|
||||
|
||||
|
||||
constructor(
|
||||
private apiRequest: ApiRequestService,
|
||||
private translate: TranslateService,
|
||||
private userInfoService: UserInfoService,
|
||||
private http: HttpClient,
|
||||
private appConfig: AppConfig,
|
||||
) { }
|
||||
|
||||
/* getAll(page?:number, size?:number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('page', typeof page === "number"? page.toString():"0");
|
||||
params = params.append('size', typeof size === "number"? size.toString():"1000");
|
||||
// get all
|
||||
// return this.apiRequest.get('api/instructors');
|
||||
// paginated data
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
|
||||
} */
|
||||
|
||||
getUserProfile(): Observable<UserProfile> {
|
||||
const _http = this.userProfileURL;
|
||||
return this.apiRequest.get(_http);
|
||||
|
||||
}
|
||||
updateUserProfile(user: UserProfile): Observable<UserProfile> {
|
||||
const _http = this.userProfileURL;
|
||||
return this.apiRequest.put(_http, user);
|
||||
}
|
||||
|
||||
uploadUserProfilePic(fileToUpload: File): Observable<any> {
|
||||
const formData: FormData = new FormData();
|
||||
formData.append('imageFile', fileToUpload, fileToUpload?.name);
|
||||
return this.http.post(this.appConfig.baseApiPath + this.postUserProfilePicURL, formData, { reportProgress: true, observe: 'events' });
|
||||
}
|
||||
|
||||
getProfilePic(): Observable<any> {
|
||||
return this.apiRequest.get(this.getUserProfilePicURL);
|
||||
}
|
||||
|
||||
|
||||
getUserAccountDetails() {
|
||||
return this.apiRequest.get(this.userAcountURL);
|
||||
}
|
||||
|
||||
saveUser(data): Observable<any> {
|
||||
return this.apiRequest.post(this.aboutWork, data);
|
||||
}
|
||||
|
||||
updateUser(id,data): Observable<any> {
|
||||
const _http = this.actionBuilderURL + "/" + id;
|
||||
return this.apiRequest.put(_http, data);
|
||||
}
|
||||
|
||||
getUser(id: number, checknumber: number): Observable<any> {
|
||||
return this.apiRequest.get(this.getids + "/" + id + "/" + checknumber);
|
||||
// return this.apiRequest.get(this.getids, data);
|
||||
|
||||
}
|
||||
private url = environment.backendUrl +"/token/";
|
||||
///////////////
|
||||
addUserinSignUP(data:any): Observable<any> {
|
||||
return this.http.post(`${this.url}users/sysaccount/savesysaccount`, data);
|
||||
}
|
||||
|
||||
adduserData(data:any): Observable<any> {
|
||||
return this.http.post(`${this.url}addOneAppUser`, data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { PasswordResetComponent } from "src/app/modules/main/admin/password-reset/password-reset.component";
|
||||
|
||||
import { UserRegistrationComponent } from "src/app/modules/main/admin/user-registration/user-registration.component";
|
||||
import { Observable } from "rxjs";
|
||||
import { UserInfoService } from "../user-info.service";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
export interface User {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
password: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface Sys_Account {
|
||||
userEmail: string;
|
||||
companyName: string;
|
||||
workspace: string;
|
||||
gstNumber: string;
|
||||
}
|
||||
|
||||
export interface SignedUpUser {
|
||||
userId: string;
|
||||
email: string;
|
||||
fullName: string;
|
||||
firstName: string;
|
||||
}
|
||||
export interface signUpInfo {
|
||||
success?: boolean;
|
||||
message?: string;
|
||||
landingPage?: string;
|
||||
user?: SignedUpUser;
|
||||
}
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserRegistrationService {
|
||||
|
||||
private baseURL = "api/user-registration"; // still not in use
|
||||
private emailExistURL = "token/email-exists"; // email exist check
|
||||
private userRegURL = "token/user-registration";
|
||||
private companyRegURL = "token/company-registration";
|
||||
private resetPasswordURL = "api/reset_password";
|
||||
|
||||
public registeredEmailKey: string = "registeredEmail";
|
||||
public localStorage: Storage = localStorage;
|
||||
public sessionStorage: Storage = sessionStorage;
|
||||
|
||||
private url = environment.backendUrl +"/token/";
|
||||
|
||||
|
||||
constructor(private apiRequest: ApiRequestService,private http:HttpClient,
|
||||
private userInfoService: UserInfoService) { }
|
||||
|
||||
/* takenUsernames: any[] = [];
|
||||
checkIfUsernameExists(username: string): Observable<boolean> {
|
||||
return of(this.takenUsernames.includes(username))
|
||||
.pipe(delay(1000));
|
||||
}
|
||||
usernameValidator(): AsyncValidatorFn {
|
||||
return (control: AbstractControl): Observable<ValidationErrors | null> => {
|
||||
return this.checkIfUsernameExists(control.value).pipe(
|
||||
map(res => {
|
||||
// if res is true, username exists, return true
|
||||
return res ? { usernameExists: true } : null;
|
||||
// NB: Return null if there is no error
|
||||
})
|
||||
);
|
||||
};
|
||||
} */
|
||||
|
||||
//Store userinfo from session storage
|
||||
storeEmail(userInfoString: string) {
|
||||
this.localStorage.setItem(this.registeredEmailKey, userInfoString);
|
||||
}
|
||||
|
||||
//Remove userinfo from session storage
|
||||
removeStoredEmail() {
|
||||
this.localStorage.removeItem(this.registeredEmailKey);
|
||||
}
|
||||
|
||||
//Get email from session storage ( WILL REMOVE AFTER REGISTER)
|
||||
getStoredEmail(): string | null {
|
||||
try {
|
||||
let userInfoString: string = this.localStorage.getItem(
|
||||
this.registeredEmailKey
|
||||
);
|
||||
if (userInfoString) {
|
||||
return userInfoString;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* === store signed up user info in storage === */
|
||||
public registeredUserKey: string = "registeredUser";
|
||||
storeSignedUpUserInfo(userInfoString: string) {
|
||||
this.sessionStorage.setItem(this.registeredUserKey, userInfoString);
|
||||
}
|
||||
removeSignedUpUserInfo() {
|
||||
this.sessionStorage.removeItem(this.registeredUserKey);
|
||||
}
|
||||
|
||||
//Get userinfo from session storage
|
||||
getSignedUpUserInfo(): SignedUpUser | null {
|
||||
try {
|
||||
let userInfoString: string = this.sessionStorage.getItem(
|
||||
this.registeredUserKey
|
||||
);
|
||||
if (userInfoString) {
|
||||
let userObj: SignedUpUser = JSON.parse(
|
||||
this.sessionStorage.getItem(this.registeredUserKey)
|
||||
);
|
||||
return userObj;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// Get Full Name from session storage
|
||||
getFirstName(): string {
|
||||
let userObj: SignedUpUser = this.getSignedUpUserInfo();
|
||||
if (userObj !== null) {
|
||||
//console.log('getFirstName() : ', userObj.firstName);
|
||||
return userObj.firstName;
|
||||
}
|
||||
return "no-user";
|
||||
}
|
||||
// Get User Email from session storage
|
||||
getEmail(): string {
|
||||
let userObj: SignedUpUser = this.getSignedUpUserInfo();
|
||||
if (userObj !== null) {
|
||||
//console.log('getEmail() : ', userObj.email);
|
||||
return userObj.email;
|
||||
}
|
||||
return "no-user";
|
||||
}
|
||||
// Get User Id from session storage
|
||||
getUserId(): string {
|
||||
let userObj: SignedUpUser = this.getSignedUpUserInfo();
|
||||
if (userObj !== null) {
|
||||
return userObj.userId;
|
||||
}
|
||||
return "no-user";
|
||||
}
|
||||
|
||||
/* === store signed up user info in storage END === */
|
||||
|
||||
/* === check if email is aailable or not === */
|
||||
emailCheck(email: UserRegistrationComponent): Observable<any> {
|
||||
return this.apiRequest.post(this.emailExistURL, email);
|
||||
}
|
||||
/* === signed up user (admin) === */
|
||||
|
||||
/* public landingPage:string = "/account-setup";
|
||||
saveUser(user: User): Observable<any> {
|
||||
let signupDataSubject: BehaviorSubject<any> = new BehaviorSubject<any>([]);
|
||||
let signupInfoReturn: signUpInfo;
|
||||
this.apiRequest.post(this.userRegURL, user).subscribe(
|
||||
(res) => {
|
||||
if (
|
||||
res !== undefined &&
|
||||
res !== null &&
|
||||
res.operationStatus === "SUCCESS"
|
||||
) {
|
||||
signupInfoReturn = {
|
||||
success: true,
|
||||
message: res.operationMessage,
|
||||
landingPage: this.landingPage,
|
||||
user: {
|
||||
userId: res.item.userId,
|
||||
email: res.item.email,
|
||||
fullName: res.item.fullname,
|
||||
firstName: res.item.firstName,
|
||||
},
|
||||
};
|
||||
console.log('signupInfoReturn : ', signupInfoReturn);
|
||||
// store signed up user info in session storage for further case
|
||||
this.storeSignedUpUserInfo(JSON.stringify(signupInfoReturn.user));
|
||||
} else {
|
||||
//Create a faliure object that we want to send back to login page
|
||||
signupInfoReturn = {
|
||||
success: false,
|
||||
message: res.operationMessage,
|
||||
landingPage: "/create-account",
|
||||
};
|
||||
}
|
||||
signupDataSubject.next(signupInfoReturn);
|
||||
},
|
||||
(err) => {
|
||||
console.log("signup error ", err);
|
||||
signupInfoReturn = {
|
||||
success: false,
|
||||
message: err.url + " >>> " + err.statusText + "[" + err.status + "]",
|
||||
landingPage: "/create-account",
|
||||
};
|
||||
}
|
||||
);
|
||||
console.log('signupDataSubject : ', signupDataSubject);
|
||||
|
||||
return signupDataSubject;
|
||||
//return this.apiRequest.post(this.userRegURL, user);
|
||||
} */
|
||||
|
||||
saveUser(user: User): Observable<any> {
|
||||
return this.apiRequest.post(this.userRegURL, user);
|
||||
}
|
||||
|
||||
/* company registration form */
|
||||
saveCompany(company: Sys_Account): Observable<any> {
|
||||
return this.apiRequest.post(this.companyRegURL, company);
|
||||
}
|
||||
|
||||
resetPassword(passwordResetRequest: PasswordResetComponent): Observable<any> {
|
||||
return this.apiRequest.post(this.resetPasswordURL, passwordResetRequest);
|
||||
}
|
||||
|
||||
/*==== CRUD APIS =====*/
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append(
|
||||
"page",
|
||||
typeof page === "number" ? page.toString() : "0"
|
||||
);
|
||||
params = params.append(
|
||||
"size",
|
||||
typeof size === "number" ? size.toString() : "1000"
|
||||
);
|
||||
//const _http = this.baseURL + '/all';
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
getByAccountId(): Observable<any[]> {
|
||||
const _http = this.baseURL + "/user-menu";
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
create(any: any): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, any);
|
||||
}
|
||||
|
||||
update(id: number, any: any): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, any);
|
||||
}
|
||||
|
||||
|
||||
///////
|
||||
|
||||
getStoredName() {
|
||||
return this.localStorage.getItem("FullName");
|
||||
}
|
||||
|
||||
removeStoredName() {
|
||||
this.localStorage.removeItem("FullName");
|
||||
}
|
||||
|
||||
sendEmail( email: any): Observable<any> {
|
||||
// const body = { account_id: accountId, email };
|
||||
const newbody = email;
|
||||
const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
|
||||
console.log(newbody);
|
||||
return this.http.post(`${this.url}user/send_email`, newbody);
|
||||
}
|
||||
|
||||
sendOTP(email: string): Observable<any> {
|
||||
return this.http.post(`${this.url}user/resend_otp?email=${email}`, {});
|
||||
}
|
||||
|
||||
// Method to verify OTP
|
||||
verifyOTP(email: string, otp: string): Observable<any> {
|
||||
return this.http.post(`${this.url}user/otp_verification?email=${email}&otp=${otp}`, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import baseUrl from '../api/helper';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { Usergrpmain } from '../../models/admin/usergrpma';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UsergrpmaintainceService {
|
||||
private baseURL = "api/updateOneUsrGrp";
|
||||
constructor(private _http: HttpClient,private apiRequest: ApiRequestService,) { }
|
||||
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/api/getAllUsrGrp`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this._http.get(`${baseUrl}/api/getOneAppUser/${Id}`);
|
||||
}
|
||||
public getbyusergrpid(id:any){
|
||||
return this._http.get(`${baseUrl}/api1/getusracces1/${id}`);
|
||||
}
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/api/addOneUsrGrp`, data);
|
||||
}
|
||||
// update
|
||||
public update(data: any){
|
||||
return this._http.post(`${baseUrl}/api/updateOneUsrGrp`, data);
|
||||
}
|
||||
updatei(id: number, projectSetup: Usergrpmain): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, projectSetup);
|
||||
}
|
||||
public getall(){
|
||||
return this._http.get(`${baseUrl}/api1/getAllData`);
|
||||
}
|
||||
public deleteusr(id:any){
|
||||
return this._http.delete(`${baseUrl}/api/delete_usrgrp/${id}`);
|
||||
}
|
||||
public delete(id:any,usrgrp:any){
|
||||
return this._http.delete(`${baseUrl}/api1/deleteGrpMenuAcces/${id}/${usrgrp}`);
|
||||
}
|
||||
public deletemain(id:any,usrgrp:any){
|
||||
return this._http.delete(`${baseUrl}/fndMenu/DelMenu_WithSub1/${id}/${usrgrp}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UsermaintanceService {
|
||||
|
||||
constructor(private _http: HttpClient,) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/api/getAllAppUser`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this._http.get(`${baseUrl}/api/getOneAppUser/${Id}`);
|
||||
}
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/api/addOneAppUser`, data);
|
||||
}
|
||||
// update
|
||||
public update(data: any){
|
||||
return this._http.put(`${baseUrl}/api/updateAppUser`, data);
|
||||
}
|
||||
//newupdate
|
||||
public updatenew(id:any,data: any){
|
||||
return this._http.put(`${baseUrl}/api/updateAppUserDto/${id}`, data);
|
||||
}
|
||||
public getallposition(){
|
||||
return this._http.get(`${baseUrl}/api/getAllPositions`);
|
||||
}
|
||||
public getbypositionid(Id:any){
|
||||
return this._http.get(`${baseUrl}/api/getPosition/${Id}`);
|
||||
}
|
||||
public getalldepartment(){
|
||||
return this._http.get(`${baseUrl}/api/getAllDepartments`);
|
||||
}
|
||||
public getbydepartmentid(Id:any){
|
||||
return this._http.get(`${baseUrl}/api/getDepartment/${Id}`);
|
||||
}
|
||||
public deleteusr(id:any){
|
||||
return this._http.delete(`${baseUrl}/api/delete_usr/${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { default as swal, SweetAlertOptions } from 'sweetalert2';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AlertService {
|
||||
constructor() { }
|
||||
|
||||
error(text = 'เกิดข้อผิดพลาด', title = '') {
|
||||
const option: SweetAlertOptions = {
|
||||
title: title,
|
||||
text: this.convertToText(text),
|
||||
icon: 'error',
|
||||
confirmButtonText: 'ตกลง'
|
||||
};
|
||||
return swal.fire(option);
|
||||
|
||||
}
|
||||
|
||||
success(text = '', title = 'Success') {
|
||||
const option: SweetAlertOptions = {
|
||||
title: title,
|
||||
text: this.convertToText(text),
|
||||
icon: 'success',
|
||||
confirmButtonText: 'Ok'
|
||||
};
|
||||
return swal.fire(option);
|
||||
|
||||
}
|
||||
|
||||
serverError(text = 'เกิดข้อผิดพลาดในการเชื่อมต่อกับเซิร์ฟเวอร์', title = 'เกิดข้อผิดพลาด') {
|
||||
const option: SweetAlertOptions = {
|
||||
title: title,
|
||||
text: this.convertToText(text),
|
||||
icon: 'error',
|
||||
confirmButtonText: 'ตกลง'
|
||||
};
|
||||
return swal.fire(option);
|
||||
|
||||
}
|
||||
|
||||
confirm(text = 'คุณต้องการดำเนินการนี้ ใช่หรือไม่?', title = 'Are you sure?') {
|
||||
const option: SweetAlertOptions = {
|
||||
title: title,
|
||||
text: this.convertToText(text),
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes',
|
||||
cancelButtonText: 'No'
|
||||
};
|
||||
return swal.fire(option);
|
||||
}
|
||||
|
||||
convertToText(text) {
|
||||
if (text && text.message) {
|
||||
return text.message
|
||||
} else if (text && text.error) {
|
||||
return text.error
|
||||
} else if (text && text.code) {
|
||||
return text.code
|
||||
} else {
|
||||
return text ? JSON.stringify(text) : '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { NavigationStart, Router } from "@angular/router";
|
||||
import { Observable, Subject } from "rxjs";
|
||||
|
||||
@Injectable()
|
||||
export class AlertService {
|
||||
private subject = new Subject<any>();
|
||||
|
||||
private keepAfterNavigationChange = false;
|
||||
|
||||
constructor(private router: Router) {
|
||||
// clear alert message on route change
|
||||
router.events.subscribe((event) => {
|
||||
if (event instanceof NavigationStart) {
|
||||
if (this.keepAfterNavigationChange) {
|
||||
// only keep for a single location change
|
||||
this.keepAfterNavigationChange = false;
|
||||
} else {
|
||||
// clear alert
|
||||
this.subject.next();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
success(message: string, keepAfterNavigationChange = false) {
|
||||
this.keepAfterNavigationChange = keepAfterNavigationChange;
|
||||
this.subject.next({ type: "success", text: message });
|
||||
}
|
||||
|
||||
error(message: string, keepAfterNavigationChange = false) {
|
||||
this.keepAfterNavigationChange = keepAfterNavigationChange;
|
||||
this.subject.next({ type: "error", text: message });
|
||||
}
|
||||
|
||||
getMessage(): Observable<any> {
|
||||
return this.subject.asObservable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
//import { id } from '@swimlane/ngx-datatable/release/utils';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AddemailsService {
|
||||
|
||||
|
||||
private addemailUrl = 'token/addemails';
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private apirequest: ApiRequestService
|
||||
|
||||
) { }
|
||||
|
||||
saveUser(data, id: number): Observable<any> {
|
||||
return this.apirequest.post(this.addemailUrl + "/" + id, data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import {
|
||||
HttpClient,
|
||||
HttpHeaders,
|
||||
HttpParams,
|
||||
HttpErrorResponse,
|
||||
} from "@angular/common/http";
|
||||
import { Router } from "@angular/router";
|
||||
import { Observable, throwError } from "rxjs";
|
||||
import { UserInfoService } from "../user-info.service";
|
||||
import { AppConfig } from "../../app-config";
|
||||
import { catchError } from "rxjs/operators";
|
||||
|
||||
@Injectable()
|
||||
export class ApiRequestService {
|
||||
constructor(
|
||||
private appConfig: AppConfig,
|
||||
private http: HttpClient,
|
||||
private router: Router,
|
||||
private userInfoService: UserInfoService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* This is a Global place to add all the request headers for every REST calls
|
||||
*/
|
||||
/*{let headers = new HttpHeaders({
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'POST, GET, DELETE, OPTIONS, PUT',
|
||||
'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding, Accept-Language, Host, Referer, Connection, User-Agent, authorization, sw-useragent, sw-version'
|
||||
});*/
|
||||
getHeaders(): HttpHeaders {
|
||||
let headers = new HttpHeaders();
|
||||
//let token = this.userInfoService.getStoredToken();
|
||||
//console.log('Token from session storage: ', token);
|
||||
headers = headers.append("Content-Type", "application/json");
|
||||
/* if (token !== null) {
|
||||
headers = headers.append("Authorization", token);
|
||||
} */
|
||||
return headers;
|
||||
}
|
||||
|
||||
getMultipartHeader(): HttpHeaders {
|
||||
let headers = new HttpHeaders();
|
||||
headers = headers.append("Content-Type", "multipart/form-data");
|
||||
return headers;
|
||||
|
||||
}
|
||||
|
||||
errMsg: string = '';
|
||||
|
||||
handleError(error: HttpErrorResponse) {
|
||||
let me = this;
|
||||
console.log("handleError ", error.message);
|
||||
switch(error.status) {
|
||||
case 401:
|
||||
this.errMsg = 'Forbidden';
|
||||
break;
|
||||
case 404:
|
||||
this.errMsg = 'Service not found';
|
||||
case 408:
|
||||
this.errMsg = 'Request Timedout';
|
||||
case 500:
|
||||
this.errMsg = 'Internal Server Error';
|
||||
default:
|
||||
this.errMsg = 'Server Error';
|
||||
}
|
||||
return throwError(error.message);
|
||||
//return Observable.throw(error.message);
|
||||
}
|
||||
|
||||
get(url: string, urlParams?: HttpParams): Observable<any> {
|
||||
let me = this;
|
||||
return this.http
|
||||
.get(this.appConfig.baseApiPath + url, {
|
||||
headers: this.getHeaders(),
|
||||
params: urlParams,
|
||||
}).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || "Server error");
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
loginAuthentication(url: string, body: Object): Observable<any> {
|
||||
let me = this;
|
||||
return this.http
|
||||
.post(this.appConfig.baseApiPath + url, JSON.stringify(body), {
|
||||
headers: this.getHeaders()
|
||||
}).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || "Server error");
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// modified params
|
||||
post(url: string, body: any, urlParams?: HttpParams): Observable<any> {
|
||||
let me = this;
|
||||
let bodyTest = body instanceof Object ? JSON.stringify(body) : body;
|
||||
//console.log('Post method String Vs. Object', bodyTest);
|
||||
return this.http
|
||||
.post(this.appConfig.baseApiPath + url, JSON.stringify(body), {
|
||||
headers: this.getHeaders(),
|
||||
params: urlParams,
|
||||
}).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || "Server error");
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// [Multipart file Support]
|
||||
postFormData(url: string, body: any, urlParams?: HttpParams): Observable<any> {
|
||||
//let me = this;
|
||||
//headers: this.getMultipartHeader(),
|
||||
return this.http
|
||||
.post(this.appConfig.baseApiPath + url, body, {
|
||||
params: urlParams,
|
||||
reportProgress: true,
|
||||
observe: 'events'
|
||||
}).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || "Server error");
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// modified params
|
||||
put(url: string, body: Object, urlParams?: HttpParams): Observable<any> {
|
||||
let me = this;
|
||||
return this.http
|
||||
.put(this.appConfig.baseApiPath + url, JSON.stringify(body), {
|
||||
headers: this.getHeaders(),
|
||||
params: urlParams,
|
||||
}).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || "Server error");
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
delete(url: string): Observable<any> {
|
||||
let me = this;
|
||||
return this.http
|
||||
.delete(this.appConfig.baseApiPath + url, { headers: this.getHeaders() })
|
||||
.pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || "Server error");
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
downloadFile(url: string, data: any[]): Observable<any> {
|
||||
return this.http.post(url, data, { responseType: 'blob' }).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || 'Server error');
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// For File Download
|
||||
getFile(url: string, options: any): Observable<any> {
|
||||
return this.http.post(this.appConfig.baseApiPath + url, { ...options, responseType: 'blob' }).pipe(
|
||||
catchError((error) => {
|
||||
return throwError(error || 'Server error');
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from './helper';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AudittrailService {
|
||||
apiurl="master/AuditItemReport";
|
||||
apiurl1="master/AuditItemReportCustom"
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService,) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/master/AuditItemReport`);
|
||||
|
||||
}
|
||||
public gettable(tname:any){
|
||||
const formData:FormData = new FormData();
|
||||
formData.set("table",tname);
|
||||
return this.apiRequest.postFormData(this.apiurl,formData);
|
||||
}
|
||||
public getdate(d1:any,d2:any,tname:any){
|
||||
const formData:FormData = new FormData();
|
||||
formData.set("id",null);
|
||||
formData.set("d1",d1);
|
||||
formData.set("d2",d2);
|
||||
formData.set("table",tname);
|
||||
return this.apiRequest.postFormData(this.apiurl1,formData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from './helper';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BillingdemoService {
|
||||
|
||||
constructor(private _http: HttpClient) { }
|
||||
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/ncso_b/get-all`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this._http.get(`${baseUrl}/ncso_b/get-one/${Id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Department } from '../../models/fnd/department';
|
||||
import { JwtHelperService } from '@auth0/angular-jwt';
|
||||
import { HttpClient, HttpParams,HttpResponse } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
import { UserInfoService } from '../user-info.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DepartmentService {
|
||||
jwtHelper: JwtHelperService = new JwtHelperService();
|
||||
|
||||
private baseURL = "api/getdepartment";
|
||||
constructor(private http: HttpClient,
|
||||
private apiRequest: ApiRequestService,
|
||||
private userInfoService: UserInfoService) { }
|
||||
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
//console.log(this.userInfoService.getUserInfo().userId);
|
||||
let id = this.userInfoService.getUserInfo().userId;
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
|
||||
update(id: number, department: Department): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, department);
|
||||
}
|
||||
getById(id: number): Observable<Department> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
create(depart:Department): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, depart);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from './helper';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DiputesemoService {
|
||||
|
||||
constructor(private _http: HttpClient) { }
|
||||
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/ncso_q/get-all`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this._http.get(`${baseUrl}/ncso_q/get-one/${Id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from '../api/helper';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ForgotpassService {
|
||||
private url = "api/forgot";
|
||||
public localStorage: Storage = localStorage;
|
||||
constructor(private http: HttpClient,) { }
|
||||
|
||||
checkMailExists(email: string) {
|
||||
return this.http.post(this.url+ "check-email", {"email": email});
|
||||
}
|
||||
storeEmail(userInfoString: string) {
|
||||
this.localStorage.setItem("registeredEmail", userInfoString);
|
||||
}
|
||||
//Store userinfo from session storage
|
||||
|
||||
//Get email from session storage ( WILL REMOVE AFTER REGISTER)
|
||||
getStoredEmail(): string | null {
|
||||
try {
|
||||
let userInfoString: string = this.localStorage.getItem(
|
||||
"registeredEmail"
|
||||
);
|
||||
if (userInfoString) {
|
||||
return userInfoString;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
sendemail(email:string){
|
||||
const params = new HttpParams()
|
||||
.set('email',email)
|
||||
console.log(email);
|
||||
return this.http.post(`${baseUrl}/api/resources/forgotpassword`,params)
|
||||
}
|
||||
resetpass(data:any,id:any){
|
||||
return this.http.post(`${baseUrl}/api/resources/savePassword/${id}`,data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import{environment} from 'src/environments/environment';
|
||||
|
||||
let baseUrl = environment.backendUrl;
|
||||
//let baseUrl= `http://cns-portal-backend:30166`;
|
||||
export default baseUrl;
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from './helper';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ItemdemoService {
|
||||
|
||||
constructor(private _http: HttpClient) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/ncso_i/get-all`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this._http.get(`${baseUrl}/ncso_i/get-one/${Id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { UserInfoService, LoginInfoInStorage} from '../user-info.service';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
|
||||
export interface LoginRequestParam{
|
||||
//username:string;
|
||||
email:string;
|
||||
password:string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class LoginService {
|
||||
private storage: Storage = sessionStorage;
|
||||
public landingPage:string = "/cns-portal/dashboard";
|
||||
constructor(
|
||||
private router:Router,
|
||||
private userInfoService: UserInfoService,
|
||||
private apiRequest: ApiRequestService,
|
||||
private httpRequest: HttpClient,
|
||||
private toastr: ToastrService,
|
||||
) {}
|
||||
|
||||
|
||||
|
||||
getToken(email:string, password:string): Observable<any> {
|
||||
let bodyData: LoginRequestParam = {
|
||||
//"username": username,
|
||||
"email": email,
|
||||
"password": password,
|
||||
}
|
||||
/*
|
||||
Using BehaviorSubject instead of Subject
|
||||
In Angular services are initialized before the components, if any component is
|
||||
subscribing, it will only receive events which are executed after subscription.
|
||||
therefore if you put a syncronize next() in the service, the component wont get it.
|
||||
|
||||
A BehaviourSubject will always provide the values wheather the subscription happened after or before event
|
||||
|
||||
*/
|
||||
|
||||
let loginDataSubject:BehaviorSubject<any> = new BehaviorSubject<any>([]); // Will use this BehaviorSubject to emit data that we want after ajax login attempt
|
||||
let loginInfoReturn:LoginInfoInStorage; // Object that we want to send back to Login Page
|
||||
|
||||
this.apiRequest.loginAuthentication('token/session', bodyData)
|
||||
.subscribe(jsonResp => {
|
||||
console.log('login response: ', jsonResp);
|
||||
if (jsonResp.operationMessage=='Login Failed') {
|
||||
this.toastr.warning('Not Login Getting Error check your Username and password');
|
||||
}
|
||||
if (jsonResp !== undefined && jsonResp !== null && jsonResp.operationStatus === "SUCCESS"){
|
||||
//Create a success object that we want to send back to login page
|
||||
////"displayName": jsonResp.item.fullname,
|
||||
//"username" : jsonResp.item.username,
|
||||
loginInfoReturn = {
|
||||
"success" : true,
|
||||
"message" : jsonResp.operationMessage,
|
||||
"landingPage": this.landingPage,
|
||||
"user" : {
|
||||
"userId" : jsonResp.item.userId,
|
||||
"email" : jsonResp.item.email,
|
||||
"displayName": jsonResp.item.firstName,
|
||||
"username" : jsonResp.item.username,
|
||||
"roles" : jsonResp.item.roles,
|
||||
"token" : jsonResp.item.token,
|
||||
|
||||
},
|
||||
};
|
||||
console.log(loginInfoReturn.user);
|
||||
if(jsonResp !== undefined && jsonResp !== null && jsonResp.operationStatus === "SUCCESS"){
|
||||
this.toastr.success(`Welcome To home Page!! your Role is ${jsonResp.item.roles}`);
|
||||
}
|
||||
// store username and jwt token in session storage to keep user logged in between page refreshes
|
||||
this.userInfoService.storeUserInfo(JSON.stringify(loginInfoReturn.user));
|
||||
}
|
||||
else {
|
||||
//Create a faliure object that we want to send back to login page
|
||||
loginInfoReturn = {
|
||||
"success":false,
|
||||
"message":jsonResp.msgDesc,
|
||||
"landingPage":"/login"
|
||||
};
|
||||
}
|
||||
loginDataSubject.next(loginInfoReturn);
|
||||
},
|
||||
err => {
|
||||
console.log('login error ', err);
|
||||
loginInfoReturn = {
|
||||
"success": false,
|
||||
"message": err.url + " >>> " + err.statusText + "[" + err.status +"]",
|
||||
"landingPage": "/login"
|
||||
};
|
||||
if (err) {
|
||||
this.toastr.error('Getting Server Error');
|
||||
}
|
||||
});
|
||||
|
||||
return loginDataSubject;
|
||||
}
|
||||
|
||||
logout(navigatetoLogout=true): void {
|
||||
// clear token remove user from local storage to log user out
|
||||
this.userInfoService.removeUserInfo();
|
||||
if(navigatetoLogout){
|
||||
this.router.navigate(["logout"]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
import { Observable } from 'rxjs';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class QueryRunnerService {
|
||||
private baseURL = "api/report-data";
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
getById(report_id:number, page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("report_id", report_id.toString());
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Rn_Main_Menu } from "../../models/builder/Rn_Main_Menu";
|
||||
import { Observable } from "rxjs";
|
||||
import { UserInfoService } from "../user-info.service";
|
||||
import { ApiRequestService } from "./api-request.service";
|
||||
|
||||
@Injectable()
|
||||
export class RealnetMenuService {
|
||||
private baseURL = "api/realnet-menu";
|
||||
constructor(
|
||||
private apiRequest: ApiRequestService,
|
||||
private userInfoService: UserInfoService
|
||||
) {}
|
||||
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<Rn_Main_Menu> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
getByAccountId(): Observable<Rn_Main_Menu[]> {
|
||||
const _http = this.baseURL + "/user-menu";
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
create(rn_Main_Menu: Rn_Main_Menu): Observable<Rn_Main_Menu> {
|
||||
return this.apiRequest.post(this.baseURL, rn_Main_Menu);
|
||||
}
|
||||
|
||||
update(id: number, rn_Main_Menu: Rn_Main_Menu): Observable<Rn_Main_Menu> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, rn_Main_Menu);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ReportBuilder } from '../../models/builder/ReportBuilder';
|
||||
import { ReportBuilderQuery } from '../../models/builder/ReportBuilderQuery';
|
||||
import { TableList } from '../../models/fnd/TableList';
|
||||
import { RptBuilder } from 'src/app/models/builder/rptBuilder';
|
||||
import baseUrl from '../api/helper';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ReportBuilderService {
|
||||
private reportBaseURL ='api/report-builder-by-id';
|
||||
private reportBaseURLSubmit ='api/report-builder';
|
||||
private masterQueryUrl ='api/add-master-query';
|
||||
private storage: Storage = sessionStorage;
|
||||
private moduleIdKey: string = "moduleId";
|
||||
private baseURLMasterQuery="api/master-query";
|
||||
private baseURL="api/edit-report";
|
||||
private reportbuild2url="api/add-report";
|
||||
private servicereportsave="api/report-builder_service";
|
||||
private updatereportservice="api/updatereport";
|
||||
|
||||
private databaselisturl='Table_list'
|
||||
private colurl='fndMenu/loadcolumn';
|
||||
private saveurl='FndQuery/query';
|
||||
constructor(private apiRequest: ApiRequestService, private _http:HttpClient) { }
|
||||
getById(id: number): Observable<ReportBuilder> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
buildReport(id: number) {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
return this.apiRequest.get("api/build_report", params);
|
||||
}
|
||||
|
||||
getModuleId(): number {
|
||||
let modId = +this.storage.getItem(this.moduleIdKey);
|
||||
return modId;
|
||||
}
|
||||
|
||||
getAll(moduleId: number, page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
params = params.append("moduleId", moduleId.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.reportBaseURL, params);
|
||||
}
|
||||
|
||||
//save report
|
||||
create(fbHeader: ReportBuilder, moduleId: number): Observable<ReportBuilder> {
|
||||
//`${this.baseURL}`
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("moduleId", moduleId.toString());
|
||||
// params = params.append("formType", formType);
|
||||
return this.apiRequest.post(this.reportBaseURLSubmit, fbHeader, params);
|
||||
}
|
||||
|
||||
//save report service
|
||||
createservicereport(fbHeader: ReportBuilder, moduleId: number): Observable<ReportBuilder> {
|
||||
//`${this.baseURL}`
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("moduleId", moduleId.toString());
|
||||
// params = params.append("formType", formType);
|
||||
return this.apiRequest.post(this.servicereportsave, fbHeader, params);
|
||||
}
|
||||
|
||||
//save report
|
||||
createQuery(reportId: number): Observable<any> {
|
||||
//`${this.baseURL}`
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("reportId", reportId.toString());
|
||||
// params = params.append("formType", formType);
|
||||
return this.apiRequest.post(this.masterQueryUrl,params);
|
||||
}
|
||||
|
||||
// update(reportId: number, functionRegister: ReportBuilder): Observable<ReportBuilder> {
|
||||
// let params: HttpParams = new HttpParams();
|
||||
// params = params.append("reportId", reportId.toString());
|
||||
// return this.apiRequest.put(this.masterQueryUrl/reportId, functionRegister);
|
||||
// }
|
||||
|
||||
update(id: number, functionRegister: ReportBuilder): Observable<ReportBuilder> {
|
||||
const _http = this.masterQueryUrl + "/" + id;
|
||||
return this.apiRequest.put(_http, functionRegister);
|
||||
}
|
||||
|
||||
updateservicereport(id: number, functionRegister: ReportBuilder): Observable<ReportBuilder> {
|
||||
const _http = this.updatereportservice + "/" + id;
|
||||
return this.apiRequest.put(_http, functionRegister);
|
||||
}
|
||||
|
||||
getMasterQuery(id: number): Observable<ReportBuilderQuery> {
|
||||
const _http = this.baseURLMasterQuery + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
getMasterData(query:string): Observable<any> {
|
||||
//Create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('sql_query', query);
|
||||
return this.apiRequest.get('api/master-query-data',params);
|
||||
}
|
||||
|
||||
|
||||
report2(servicename):Observable<any>
|
||||
{
|
||||
console.log("in service",servicename);
|
||||
|
||||
// let params: HttpParams = new HttpParams();
|
||||
// params = params.append('service_name', servicename);
|
||||
|
||||
// console.log(this.reportbuild2url,params);
|
||||
|
||||
return this.apiRequest.post(this.reportbuild2url,servicename);
|
||||
}
|
||||
|
||||
|
||||
//savequery
|
||||
saveq(data:any):Observable<any>{
|
||||
return this.apiRequest.post(this.saveurl,data);
|
||||
}
|
||||
//getall
|
||||
getall(){
|
||||
return this.apiRequest.get(this.saveurl);
|
||||
}
|
||||
|
||||
///////
|
||||
getreportdata(apiname):Observable<any>
|
||||
{
|
||||
var url="api"+"/"+apiname;
|
||||
console.log(url)
|
||||
|
||||
return this.apiRequest.get(url);
|
||||
|
||||
}
|
||||
getdatabse(): Observable<any>{
|
||||
return this.apiRequest.get(`SqlworkbenchSqlcont/sql`);
|
||||
//return this.apiRequest.get(this.databaselisturl);
|
||||
}
|
||||
getTableListn(val:any): Observable<TableList[]> {
|
||||
return this.apiRequest.get(`Table_list/${val}`);
|
||||
}
|
||||
getcolListn(val:any,val1:any): Observable<TableList[]> {
|
||||
return this.apiRequest.get(`Table_list/${val}/${val1}`);
|
||||
}
|
||||
|
||||
//column list for multiple tables
|
||||
getColumnList(tableSchema: any, tables: any): Observable<any> {
|
||||
// return this._http.get( `http://localhost:9191/AllTable_list/${tableSchema}`,tables);
|
||||
const params = new HttpParams().set('str', tables.join(','));
|
||||
return this._http.get(`${baseUrl}/AllTable_list/${tableSchema}`, { params: params });
|
||||
}
|
||||
|
||||
//working column list for multiple tables with alias
|
||||
getAllColumnsFromAllTables(tableNames: any): Observable<any> {
|
||||
const url = `${baseUrl}/Alias_Table_list/${tableNames}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
getcollist(table:any){
|
||||
const _http = this.colurl+ "/" + table;
|
||||
return this.apiRequest.get(_http);
|
||||
//return this.apiRequest.get(`this.colurl/${table}`);
|
||||
}
|
||||
createdb(data:any){
|
||||
return this.apiRequest.post(`SqlworkbenchSqlcont/sql`,data);
|
||||
}
|
||||
|
||||
updateSqlModel(id: number, sqlModel: any): Observable<any> {
|
||||
return this.apiRequest.put(`SqlworkbenchSqlcont/sql/${id}`, sqlModel);
|
||||
}
|
||||
|
||||
getSqlModelById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`SqlworkbenchSqlcont/sql/${id}`);
|
||||
}
|
||||
|
||||
deleteSqlModel(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`SqlworkbenchSqlcont/sql/${id}`);
|
||||
}
|
||||
|
||||
getallentity(){
|
||||
return this.apiRequest.get(this.reportBaseURLSubmit);
|
||||
}
|
||||
|
||||
|
||||
////////// rpt builders //////////////
|
||||
|
||||
saveData(data: RptBuilder): Observable<RptBuilder> {
|
||||
return this.apiRequest.post(`Rpt_builder/Rpt_builder`, data);
|
||||
}
|
||||
|
||||
getDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Rpt_builder/Rpt_builder`);
|
||||
}
|
||||
|
||||
getDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Rpt_builder/Rpt_builder/${id}`);
|
||||
}
|
||||
|
||||
deleteById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`Rpt_builder/Rpt_builder/${id}`);
|
||||
}
|
||||
|
||||
updateData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`Rpt_builder/Rpt_builder/${id}`, data);
|
||||
}
|
||||
|
||||
|
||||
////////// rpt builders 2//////////////
|
||||
|
||||
saverbData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`Rpt_builder2/Rpt_builder2`, data);
|
||||
}
|
||||
|
||||
getrbDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Rpt_builder2/Rpt_builder2`);
|
||||
}
|
||||
|
||||
getrbDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Rpt_builder2/Rpt_builder2/${id}`);
|
||||
}
|
||||
|
||||
deletrbById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`Rpt_builder2/Rpt_builder2/${id}`);
|
||||
}
|
||||
|
||||
updaterbData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`Rpt_builder2/Rpt_builder2/${id}`, data);
|
||||
}
|
||||
|
||||
updaterbLineData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`Rpt_builder2_lines/update/${id}`, data);
|
||||
}
|
||||
|
||||
getrbLineDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Rpt_builder2_lines/Rpt_builder2_lines/${id}`);
|
||||
}
|
||||
|
||||
/// rpt builders 2 html
|
||||
getStdParamById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Rpt_builder2/html/build_report2/${id}`);
|
||||
}
|
||||
//get key from URL
|
||||
getcolumnDetailsByurl(url: string): Observable<any> {
|
||||
const apiUrl = `Rpt_builder2_lines/geturlkeybyurl?url=${url}`;
|
||||
return this.apiRequest.get(apiUrl);
|
||||
}
|
||||
|
||||
getAllDetailsByurl(url: string): Observable<any> {
|
||||
const apiUrl = `Rpt_builder2_lines/fetch_data_url?url=${url}`;
|
||||
return this.apiRequest.get(apiUrl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////// DOWNLOADS
|
||||
// downloadFile(format:any,data: any): Observable<any> {
|
||||
// return this.apiRequest.post(`rbbuilder/fileconverter/downloadFile/${format}`, data);
|
||||
// }
|
||||
|
||||
downloadFile(format: string, dataList: any[],name?:String): void {
|
||||
const url = `${baseUrl}/rbbuilder/fileconverter/downloadFile/${format}`;
|
||||
this.apiRequest.downloadFile(url, dataList).subscribe(
|
||||
(response: Blob) => {
|
||||
saveAs(response, `${name}.${format}`);
|
||||
},
|
||||
(error) => {
|
||||
console.error('Error downloading file:', error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SequenceService {
|
||||
|
||||
constructor(private apiRequest: ApiRequestService,) { }
|
||||
public getAll() {
|
||||
return this.apiRequest.get(`sureserve/sequence/seq`);
|
||||
}
|
||||
public getbyid(Id: any){
|
||||
return this.apiRequest.get(`sureserve/sequence/seq/${Id}`);
|
||||
}
|
||||
|
||||
public create(data: any){
|
||||
return this.apiRequest.post(`sureserve/sequence/create`, data);
|
||||
}
|
||||
// update
|
||||
public update(id:any,data: any){
|
||||
return this.apiRequest.put(`sureserve/sequence/seq/${id}`, data);
|
||||
}
|
||||
|
||||
|
||||
public delete(id:any){
|
||||
return this.apiRequest.delete(`sureserve/sequence/seq/${id}`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RbTables } from '../../models/builder/RbTables';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from './api-request.service';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { TableList } from '../../models/fnd/TableList';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TableSetupService {
|
||||
private baseURL = 'api/add-tables';
|
||||
private baseURL2 = 'api/add-alltables';
|
||||
private tableListUrl ='api/table-list';
|
||||
private tablelisturl='api/Table_list'
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
create(rb_tables: RbTables,reportId: number) :Observable<RbTables> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("reportId", reportId.toString());
|
||||
return this.apiRequest.post(this.baseURL2, rb_tables,params);
|
||||
}
|
||||
|
||||
getTableList(): Observable<TableList[]> {
|
||||
return this.apiRequest.get(this.tableListUrl);
|
||||
}
|
||||
getTableListn(): Observable<TableList[]> {
|
||||
return this.apiRequest.get(this.tablelisturl);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Injectable, Inject } from '@angular/core';
|
||||
import { AppConfig } from '../../app-config';
|
||||
|
||||
@Injectable()
|
||||
export class TranslateService {
|
||||
constructor(private appConfig:AppConfig) {
|
||||
// Code to get Locale Info from Session Storage
|
||||
}
|
||||
|
||||
getDateString(datenum:number):string{
|
||||
return new Date(datenum).toLocaleDateString(this.appConfig.locale);
|
||||
}
|
||||
|
||||
getCurrencyString(number:number):string {
|
||||
return number.toLocaleString(this.appConfig.locale, this.appConfig.currencyFormat);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { UserInfoService } from './user-info.service';
|
||||
import { LoginService } from './api/login.service';
|
||||
import { Router, CanActivate, CanActivateChild,ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
|
||||
@Injectable()
|
||||
export class AuthGuard implements CanActivate, CanActivateChild {
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private loginService: LoginService,
|
||||
private userInfoService: UserInfoService
|
||||
) { }
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
||||
//console.log('canActivate : ', state);
|
||||
|
||||
let url: string = state.url;
|
||||
|
||||
return this.checkLogin(url);
|
||||
//return true;
|
||||
}
|
||||
|
||||
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
||||
return this.canActivate(route, state);
|
||||
}
|
||||
|
||||
checkLogin(url: string): boolean {
|
||||
if (this.userInfoService.isLoggedIn()) {
|
||||
return true;
|
||||
}
|
||||
console.log("User is not logged - This routing guard prvents redirection to any routes that needs logging.");
|
||||
//Store the original url in login service and then redirect to login page
|
||||
this.loginService.landingPage = url;
|
||||
this.router.navigate(['login',]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AdditionalcontainerService } from './additionalcontainer.service';
|
||||
|
||||
describe('AdditionalcontainerService', () => {
|
||||
let service: AdditionalcontainerService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(AdditionalcontainerService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,75 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AdditionalcontainerService {
|
||||
baseurl = environment.sureops;
|
||||
private baseURL = "Gaurav_testing/Gaurav_testing" ;
|
||||
constructor(private apiRequest: ApiRequestService,
|
||||
private _http: HttpClient,) { }
|
||||
|
||||
|
||||
saveData(data: any): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/Additional_container`;
|
||||
return this._http.post(url, data);
|
||||
}
|
||||
|
||||
getDetails(): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/Additional_container`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
getDetailsById(id: number): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/Additional_container/${id}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
deleteById(id: number): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/Additional_container/${id}`;
|
||||
return this._http.delete(url);
|
||||
}
|
||||
|
||||
update(data: any, id: number): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/Additional_container/${id}`;
|
||||
return this._http.put(url, data);
|
||||
}
|
||||
|
||||
///copy ADDITIONAL CONTAINER TO CREATE DEPLOYMENT
|
||||
public copyToCreateDeployment(projId: number, profileId: number, service: string): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}/${service}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
// get all by project id and profile id
|
||||
getAllContainers(projId: number, profileId: number): Observable<any> {
|
||||
const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
|
||||
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);
|
||||
}
|
||||
updategaurav(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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DashboardService } from './dashboard.service';
|
||||
|
||||
describe('DashboardService', () => {
|
||||
let service: DashboardService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DashboardService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,116 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DashboardService {
|
||||
|
||||
private getAllURL = 'get_module_id';
|
||||
private addDataURl = 'Savedata';
|
||||
private deleteFieldURL = 'delete_by_header_id';
|
||||
private getbyidURL = 'get_dashboard_headerbyid';
|
||||
private editURL = 'update_Dashbord1_Line';
|
||||
private updateURL = 'update_Dashbord1_Lineby_id';
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService,)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
getAllDash(): Observable<any> {
|
||||
// create Request URL params
|
||||
return this.apiRequest.get(`get_Dashboard_header`);
|
||||
}
|
||||
|
||||
getAllByModuleId(module_id: number,page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
params = params.append("module_id", module_id.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.getAllURL, params);
|
||||
}
|
||||
|
||||
create(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
|
||||
deleteField(id:number){
|
||||
let _http = this.deleteFieldURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
getById(id:number)
|
||||
{
|
||||
let _http = this.getbyidURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
addToDB(line:any):Observable<any>
|
||||
{
|
||||
return this.apiRequest.put(this.editURL,line);
|
||||
}
|
||||
UpdateLineData(id:number, line:any)
|
||||
{
|
||||
// line = {
|
||||
// headers: new HttpHeaders({
|
||||
// 'Content-Type': 'application/json'
|
||||
// })
|
||||
// };
|
||||
let _http = this.updateURL + "/" + id;
|
||||
return this.apiRequest.put(_http,line);
|
||||
}
|
||||
getcount(moduleId: number):Observable<any>{
|
||||
return this.apiRequest.get(`get_dashboard/${moduleId}`);
|
||||
}
|
||||
|
||||
updateDash(dashboardHeader: any): Observable<any> {
|
||||
return this.apiRequest.put('update_dashboard_header', dashboardHeader);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///////schedule
|
||||
public saveData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`DashboardSchedule/DashboardSchedule`, data);
|
||||
}
|
||||
|
||||
public getDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`DashboardSchedule/DashboardSchedule`);
|
||||
}
|
||||
|
||||
public getDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`DashboardSchedule/DashboardSchedule/${id}`);
|
||||
}
|
||||
|
||||
public deleteById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`DashboardSchedule/DashboardSchedule/${id}`);
|
||||
}
|
||||
|
||||
public updateData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`DashboardSchedule/DashboardSchedule/${id}`, data);
|
||||
}
|
||||
|
||||
private toggleSubject = new BehaviorSubject<boolean>(false);
|
||||
|
||||
// Observable to subscribe to toggle changes
|
||||
toggle$ = this.toggleSubject.asObservable();
|
||||
|
||||
// Function to update the toggle value
|
||||
updateToggle(value: boolean) {
|
||||
this.toggleSubject.next(value);
|
||||
}
|
||||
|
||||
private originalData: any[] = []; // Your original data goes here
|
||||
private filteredDataSubject = new BehaviorSubject<any[]>([]);
|
||||
filteredData$: Observable<any[]> = this.filteredDataSubject.asObservable();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Dashboard3Service } from './dashboard3.service';
|
||||
|
||||
describe('Dashboard3Service', () => {
|
||||
let service: Dashboard3Service;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(Dashboard3Service);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,308 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http";
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from "src/app/services/api/api-request.service";
|
||||
import baseUrl from '../api/helper';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class Dashboard3Service {
|
||||
getAdditionalChartData() {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
private getAllURL = 'get_module_id';
|
||||
private addDataURl = 'Savedata';
|
||||
private deleteFieldURL = 'delete_by_header_id';
|
||||
private getbyidURL = 'get_dashboard_headerbyid';
|
||||
private editURL = 'update_Dashbord1_Line';
|
||||
private updateURL = 'update_Dashbord1_Lineby_id';
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService) { }
|
||||
getAll(module_id: number,page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
params = params.append("module_id", module_id.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.getAllURL, params);
|
||||
}
|
||||
|
||||
create(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
|
||||
deleteField(id:number){
|
||||
let _http = this.deleteFieldURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
getById(id:number)
|
||||
{
|
||||
let _http = this.getbyidURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
addToDB(line:any):Observable<any>
|
||||
{
|
||||
return this.apiRequest.put(this.editURL,line);
|
||||
}
|
||||
UpdateLineData(id:number, line:any)
|
||||
{
|
||||
// line = {
|
||||
// headers: new HttpHeaders({
|
||||
// 'Content-Type': 'application/json'
|
||||
// })
|
||||
// };
|
||||
let _http = this.updateURL + "/" + id;
|
||||
return this.apiRequest.put(_http,line);
|
||||
}
|
||||
getcount(moduleId: number):Observable<any>{
|
||||
return this.apiRequest.get(`get_dashboard/${moduleId}`);
|
||||
}
|
||||
|
||||
updateDash(dashboardHeader: any): Observable<any> {
|
||||
return this.apiRequest.put('update_dashboard_header', dashboardHeader);
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
resetConditions() {
|
||||
this.ids = []; // Reset the ids array to an empty array
|
||||
this.numberIds = [];
|
||||
this.passwordIds = [];
|
||||
this.textareaIds = [];
|
||||
this.dateIds = [];
|
||||
this.datetimeIds = [];
|
||||
this.emailIds = [];
|
||||
this.selectIds = [];
|
||||
this.radioIds = [];
|
||||
this.checkboxIds = [];
|
||||
this.fileuloadIds = [];
|
||||
this.urlIds = [];
|
||||
this.decimalIds = [];
|
||||
this.percentageIds = [];
|
||||
this.buttonIds = [];
|
||||
}
|
||||
|
||||
//////////// Text
|
||||
ids: any[] = [];
|
||||
setCondition(condition: any) {
|
||||
this.ids.push(condition);
|
||||
}
|
||||
|
||||
getConditions(): any[] {
|
||||
return this.ids;
|
||||
}
|
||||
|
||||
|
||||
////////// Number
|
||||
numberIds: any[] = [];
|
||||
setnumber(id: any) {
|
||||
this.numberIds.push(id);
|
||||
}
|
||||
|
||||
getnumber(): any[] {
|
||||
return this.numberIds;
|
||||
}
|
||||
////////////// password
|
||||
passwordIds: any[] = [];
|
||||
setpassword(id: any) {
|
||||
this.passwordIds.push(id);
|
||||
}
|
||||
|
||||
getpassword(): any[] {
|
||||
return this.passwordIds;
|
||||
}
|
||||
|
||||
////////////// Textarea
|
||||
textareaIds: any[] = [];
|
||||
setTextarea(id: any) {
|
||||
this.textareaIds.push(id);
|
||||
}
|
||||
|
||||
getTextarea(): any[] {
|
||||
return this.textareaIds;
|
||||
}
|
||||
|
||||
////////////// Date
|
||||
dateIds: any[] = [];
|
||||
setDate(id: any) {
|
||||
this.dateIds.push(id);
|
||||
}
|
||||
|
||||
getDate(): any[] {
|
||||
return this.dateIds;
|
||||
}
|
||||
|
||||
////////////// Datetime
|
||||
datetimeIds: any[] = [];
|
||||
setDatetime(id: any) {
|
||||
this.datetimeIds.push(id);
|
||||
}
|
||||
|
||||
getDatetime(): any[] {
|
||||
return this.datetimeIds;
|
||||
}
|
||||
|
||||
////////////// Email
|
||||
emailIds: any[] = [];
|
||||
setEmail(id: any) {
|
||||
this.emailIds.push(id);
|
||||
}
|
||||
|
||||
getEmail(): any[] {
|
||||
return this.emailIds;
|
||||
}
|
||||
|
||||
////////////// Select
|
||||
selectIds: any[] = [];
|
||||
setSelect(id: any) {
|
||||
this.selectIds.push(id);
|
||||
}
|
||||
|
||||
getSelect(): any[] {
|
||||
return this.selectIds;
|
||||
}
|
||||
|
||||
////////////// Radio
|
||||
radioIds: any[] = [];
|
||||
setRadio(id: any) {
|
||||
this.radioIds.push(id);
|
||||
}
|
||||
|
||||
getRadio(): any[] {
|
||||
return this.radioIds;
|
||||
}
|
||||
|
||||
////////////// Checkbox
|
||||
checkboxIds: any[] = [];
|
||||
setCheckbox(id: any) {
|
||||
this.checkboxIds.push(id);
|
||||
}
|
||||
|
||||
getCheckbox(): any[] {
|
||||
return this.checkboxIds;
|
||||
}
|
||||
|
||||
////////////// fileupload
|
||||
fileuloadIds: any[] = [];
|
||||
setFileUpload(id: any) {
|
||||
this.fileuloadIds.push(id);
|
||||
}
|
||||
|
||||
getFileupload(): any[] {
|
||||
return this.fileuloadIds;
|
||||
}
|
||||
|
||||
////////////// Url
|
||||
urlIds: any[] = [];
|
||||
setUrl(id: any) {
|
||||
this.urlIds.push(id);
|
||||
}
|
||||
|
||||
getUrl(): any[] {
|
||||
return this.urlIds;
|
||||
}
|
||||
////////////// Decimal
|
||||
decimalIds: any[] = [];
|
||||
setDecimal(id: any) {
|
||||
this.decimalIds.push(id);
|
||||
}
|
||||
|
||||
getDecimal(): any[] {
|
||||
return this.decimalIds;
|
||||
}
|
||||
////////////// Percentage
|
||||
percentageIds: any[] = [];
|
||||
setPercentage(id: any) {
|
||||
this.percentageIds.push(id);
|
||||
}
|
||||
|
||||
getPercentage(): any[] {
|
||||
return this.percentageIds;
|
||||
}
|
||||
////////////// Button
|
||||
buttonIds: any[] = [];
|
||||
setButton(id: any) {
|
||||
this.buttonIds.push(id);
|
||||
}
|
||||
|
||||
getButton(): any[] {
|
||||
return this.buttonIds;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getAllDash(): Observable<any> {
|
||||
// create Request URL params
|
||||
return this.apiRequest.get(`get_Dashboard_header`);
|
||||
}
|
||||
|
||||
getAllByModuleId(module_id: number,page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
params = params.append("module_id", module_id.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.getAllURL, params);
|
||||
}
|
||||
|
||||
///////schedule
|
||||
public saveData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`DashboardSchedule/DashboardSchedule`, data);
|
||||
}
|
||||
|
||||
public getDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`DashboardSchedule/DashboardSchedule`);
|
||||
}
|
||||
|
||||
public getDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`DashboardSchedule/DashboardSchedule/${id}`);
|
||||
}
|
||||
|
||||
public deleteById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`DashboardSchedule/DashboardSchedule/${id}`);
|
||||
}
|
||||
|
||||
public updateData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`DashboardSchedule/DashboardSchedule/${id}`, data);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public getDynamicDashDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Dashboard/Dashboard`);
|
||||
}
|
||||
|
||||
public getChartData(tableName: string, jobType: string, xAxis?:any,yAxes?:any ): Observable<any> {
|
||||
const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&xAxis=${xAxis}&yAxes=${yAxes}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
public getUrlChartData(tableName: string, jobType: string, xAxis:any,yAxes:any,store:any,chartUrl:any): Observable<any> {
|
||||
const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&url=${chartUrl}&xAxis=${xAxis}&yAxes=${yAxes}&datastore_name=${store}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
featchDynamicUrlDetails(url): Observable<any> {
|
||||
return this._http.get(`${url}`);
|
||||
}
|
||||
|
||||
|
||||
private filteredDataSubject = new BehaviorSubject<any[]>([]);
|
||||
filteredData$ = this.filteredDataSubject.asObservable();
|
||||
|
||||
updateFilteredData(filteredData: any[]) {
|
||||
this.filteredDataSubject.next(filteredData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class IconService {
|
||||
private addURL = "api/addFavById";
|
||||
private removeURL= "api/removeFavById";
|
||||
private pinurl ="api/addPinById";
|
||||
private pinremove ="api/removePinById";
|
||||
private starurl ="api/addStarById";
|
||||
private starremove ="api/removeStarById";
|
||||
private watchurl ="api/addWatchlistById";
|
||||
private watchremove = "api/removeWatchlistById";
|
||||
private futureurl = "api/addFuturisticById";
|
||||
private futureremove = "api/removeFuturisticById";
|
||||
private archurl ="api/addArchiveById";
|
||||
constructor(private apiRequest: ApiRequestService,) { }
|
||||
create(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.addURL, data);
|
||||
}
|
||||
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.removeURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
createpin(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.pinurl, data);
|
||||
}
|
||||
|
||||
deletepin(id: number): Observable<any> {
|
||||
const _http = this.pinremove + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
createstar(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this. starurl, data);
|
||||
}
|
||||
|
||||
deletestar(id: number): Observable<any> {
|
||||
const _http = this.starremove + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
createwatch(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this. watchurl, data);
|
||||
}
|
||||
|
||||
deletewatch(id: number): Observable<any> {
|
||||
const _http = this.watchremove + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
createfuture(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.futureurl, data);
|
||||
}
|
||||
|
||||
deletefuture(id: number): Observable<any> {
|
||||
const _http = this.futureremove + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
createarch(data:any): Observable<any> {
|
||||
return this.apiRequest.post(this.archurl, data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ModuleSetup } from "../../models/builder/Module_Setup";
|
||||
import { Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ModulesetupService {
|
||||
private baseURL = "api/module-setup";
|
||||
private copyModuleURL = 'api/module-copy';
|
||||
private allrepourl ='api/getAllMyRepos';
|
||||
constructor( private apiRequest: ApiRequestService) { }
|
||||
getAll(page?: number, size?: number): Observable<any> { // not in use
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
|
||||
getProjectModules(projectId:number, page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("projectId", projectId.toString());
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
getByAccountId(): Observable<ModuleSetup[]> {
|
||||
const _http = this.baseURL + "/user-menu";
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
create(moduleSetup: ModuleSetup): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
// params = params.append("p_id", projectId.toString());
|
||||
return this.apiRequest.post(this.baseURL, moduleSetup);
|
||||
}
|
||||
|
||||
update(id: number, moduleSetup: ModuleSetup): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, moduleSetup);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
copy(moduleCopyForm: Object) :Observable<any> {
|
||||
return this.apiRequest.post(this.copyModuleURL, moduleCopyForm);
|
||||
}
|
||||
|
||||
getByallrepouserId(id: number): Observable<ModuleSetup> {
|
||||
const _http = this.allrepourl + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////backend Configuration
|
||||
|
||||
saveData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`BackendConfig/BackendConfig`, data);
|
||||
}
|
||||
|
||||
getDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`BackendConfig/BackendConfig`);
|
||||
}
|
||||
|
||||
getDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`BackendConfig/BackendConfig/${id}`);
|
||||
}
|
||||
|
||||
deleteById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`BackendConfig/BackendConfig/${id}`);
|
||||
}
|
||||
|
||||
updatebackend(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`BackendConfig/BackendConfig/${id}`, data);
|
||||
}
|
||||
|
||||
getAllViaModule(module_id: number): Observable<any> {
|
||||
return this.apiRequest.get(`BackendConfig/moduleid/${module_id}`);
|
||||
}
|
||||
|
||||
getAllViaProject(project_id: number): Observable<any> {
|
||||
return this.apiRequest.get(`BackendConfig/by_project/${project_id}`);
|
||||
}
|
||||
|
||||
|
||||
/////Database Configuration
|
||||
|
||||
saveDBData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`Dbconfig/Dbconfig`, data);
|
||||
}
|
||||
|
||||
getDBDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Dbconfig/Dbconfig`);
|
||||
}
|
||||
|
||||
getDBDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Dbconfig/Dbconfig/${id}`);
|
||||
}
|
||||
|
||||
deleteDBById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`Dbconfig/Dbconfig/${id}`);
|
||||
}
|
||||
|
||||
updateDB(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`Dbconfig/Dbconfig/${id}`, data);
|
||||
}
|
||||
|
||||
getDBAllViaModule(moduleid: number): Observable<any> {
|
||||
return this.apiRequest.get(`Dbconfig/bymoduleid/${moduleid}`);
|
||||
}
|
||||
|
||||
getDBAllViaProject(project_id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Dbconfig/by_proj_id/${project_id}`);
|
||||
}
|
||||
|
||||
|
||||
testConnection(databaseType: string, username: string, password: string, portnumber: string, dbhostname: string, database_name): Observable<any>{
|
||||
const url = 'suredata/test/testconnection';
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("database_type",databaseType);
|
||||
params =params.append("username",username);
|
||||
params =params.append("password",password);
|
||||
params =params.append("portnumber",portnumber);
|
||||
params =params.append("dbhostname",dbhostname);
|
||||
params =params.append("database_name",database_name)
|
||||
return this.apiRequest.get(url, params);
|
||||
}
|
||||
|
||||
|
||||
//////get all config
|
||||
|
||||
getConfigById(moduleid: number): Observable<any> {
|
||||
return this.apiRequest.get(`fnd/project/getallconfig/${moduleid}`);
|
||||
}
|
||||
|
||||
//==============Module_library===============//
|
||||
|
||||
// copyToLibrary(id: number): Observable<any> {
|
||||
// return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`);
|
||||
// }
|
||||
|
||||
copyFromLibrary(library_id: number, proj_id: number): Observable<any> {
|
||||
return this.apiRequest.get(`library/modulelibrary/copyfrommodulelibrarytomodule/${library_id}/${proj_id}`);
|
||||
}
|
||||
|
||||
|
||||
addToLibrary(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`library/modulelibrary/copyfromrn_module/${id}`);
|
||||
}
|
||||
|
||||
getdetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Wf_library/Wf_library`);
|
||||
}
|
||||
|
||||
getLibrarydetails(): Observable<any> {
|
||||
return this.apiRequest.get(`library/modulelibrary/getall_module_lib`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProjectSetupService } from './project-setup.service';
|
||||
|
||||
describe('ProjectSetupService', () => {
|
||||
let service: ProjectSetupService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ProjectSetupService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,237 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ProjectSetup } from "../../models/builder/Project_setup";
|
||||
import { forkJoin, Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
import { HttpClient} from '@angular/common/http';
|
||||
import { map } from 'rxjs/operators';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProjectSetupService {
|
||||
private baseURL = "api/project-setup";
|
||||
//private copyProjectURL = 'api/project-list';
|
||||
private copyProjectURL = 'api/project-copy';
|
||||
private recenmodiurl = 'api/getAllRecentPrjs';
|
||||
private recentarchivedurl = 'api/getAllArchivedPrjs';
|
||||
private allfavurl='api/getAllFavPrjsdet';
|
||||
private getalluserid='api/GetAllByUserId';
|
||||
private addboardandprourl='api/addBoardClmnsOther';
|
||||
private getrepourl ='api/getmodulename';
|
||||
private copydeployurl='api/Git_copy';
|
||||
data: any;
|
||||
obj:any;
|
||||
private storage: Storage = sessionStorage;
|
||||
constructor(private apiRequest: ApiRequestService,
|
||||
private http: HttpClient) { this.getAll().subscribe(data => {}, error => console.log(error));
|
||||
localStorage.setItem('project',JSON.stringify(this.data));
|
||||
}
|
||||
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
//const _http = this.baseURL + '/all';
|
||||
return this.apiRequest.get(this.baseURL, params);
|
||||
}
|
||||
getallmyproject(): Observable<any>{
|
||||
return this.apiRequest.get(`fnd/project/myproject`);
|
||||
}
|
||||
getalljson(){
|
||||
|
||||
return this.http.get('../assets/data/data.json').pipe
|
||||
(map(data => {
|
||||
this.data = data;
|
||||
console.log(data);
|
||||
}, err => {
|
||||
if (err) {
|
||||
return err.json();
|
||||
}
|
||||
}));
|
||||
return this.apiRequest.get(this.baseURL);
|
||||
}
|
||||
getById(id: number): Observable<ProjectSetup> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
|
||||
create(projectSetup: ProjectSetup): Observable<any> {
|
||||
return this.apiRequest.post(this.baseURL, projectSetup);
|
||||
}
|
||||
|
||||
update(id: number, projectSetup: ProjectSetup): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, projectSetup);
|
||||
}
|
||||
|
||||
copy(projectCopyForm: Object) :Observable<any> {
|
||||
return this.apiRequest.post(this.copyProjectURL, projectCopyForm);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.baseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
//recently modify
|
||||
getallrecentmodify(id: number): Observable<any> {
|
||||
const _http = this.recenmodiurl + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
getallrecentarchived(id:number): Observable<any>{
|
||||
const _http = this.recentarchivedurl + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
getallfav(id:number): Observable<any>{
|
||||
const _http = this.allfavurl + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
getallsharedwithme(): Observable<any>{
|
||||
return this.apiRequest.get(`workspace/secworkspaceuser/sharedwithme`);
|
||||
}
|
||||
getallbyuserid(id:number): Observable<any>{
|
||||
const _http = this.getalluserid + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
public sample(data1,data2): Observable<any[]>{
|
||||
let call1=this.apiRequest.post(this.baseURL, data1)
|
||||
let call2=this.apiRequest.post(this.addboardandprourl,data2)
|
||||
return forkJoin([call1, call2]);
|
||||
}
|
||||
|
||||
getprojectname(){
|
||||
return this.http.get(`${baseUrl}/api/getprojectname`);
|
||||
}
|
||||
getreponame(projectId:any,page?: number, size?: number){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("projectId", projectId.toString());
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
return this.apiRequest.get(this.getrepourl, params);
|
||||
//return this.http.get(`${baseUrl}/api/getmodulename`,params);
|
||||
}
|
||||
getmilstonename(){
|
||||
return this.http.get(`${baseUrl}/milestonename`);
|
||||
}
|
||||
getiterationname(){
|
||||
return this.http.get(`${baseUrl}/iterationname`);
|
||||
}
|
||||
getgoalname(){
|
||||
return this.http.get(`${baseUrl}/goalname`);
|
||||
}
|
||||
getpmusername(){
|
||||
return this.http.get(`${baseUrl}/pmusername`);
|
||||
}
|
||||
getallteam(){
|
||||
return this.http.get(`${baseUrl}/Sec_team`);
|
||||
}
|
||||
getallreport(){
|
||||
return this.http.get(`${baseUrl}/Report_to`);
|
||||
}
|
||||
getallassign(){
|
||||
return this.http.get(`${baseUrl}/Assign`);
|
||||
}
|
||||
getallrequestor(){
|
||||
return this.http.get(`${baseUrl}/Requestor`);
|
||||
}
|
||||
getallowner(){
|
||||
return this.http.get(`${baseUrl}/Owner`);
|
||||
}
|
||||
getalltype(){
|
||||
return this.http.get(`${baseUrl}/DD_type`);
|
||||
}
|
||||
|
||||
public build(Id: any){
|
||||
return this.apiRequest.get(`entityBuilder/BuildByProject/${Id}`);
|
||||
}
|
||||
private pdata: string = "pdata";
|
||||
public storeaddeditvalues(pdata:any,) {
|
||||
this.storage.setItem(this.pdata,JSON.stringify (pdata));
|
||||
//console.log(this.data);
|
||||
}
|
||||
getdata(): any {
|
||||
//console.log(this.data);
|
||||
var pdata = JSON.parse(this.storage.getItem(this.pdata));
|
||||
//let data = this.storage.getItem(this.data);
|
||||
return pdata;
|
||||
}
|
||||
copydeployment(projectId:any,deployment:any,msg: any,newprojectname:any,repo_cond:any){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("copy_from",projectId);
|
||||
params =params.append("Deployment_profile",deployment);
|
||||
params =params.append("commit_msg",msg);
|
||||
params =params.append("newproject_name",newprojectname),
|
||||
params=params.append("repo_cond",repo_cond)
|
||||
return this.http.post(`${baseUrl}/api/Git_copy`,params);
|
||||
//return this.apiRequest.post(this.copydeployurl,params);
|
||||
//return this.http.get(`${baseUrl}/api/getmodulename`,params);
|
||||
|
||||
}
|
||||
private gitiareponame: string = "data";
|
||||
public storeaddedgitiareponame(data:any,) {
|
||||
this.storage.setItem(this.gitiareponame,JSON.stringify (data));
|
||||
//console.log(this.data);
|
||||
}
|
||||
getgitiareponame(): any {
|
||||
//console.log(this.data);
|
||||
var data = JSON.parse(this.storage.getItem(this.gitiareponame));
|
||||
//let data = this.storage.getItem(this.data);
|
||||
return data;
|
||||
}
|
||||
public removereponame() {
|
||||
this.storage.removeItem(this.gitiareponame);
|
||||
}
|
||||
private repoIdKey: any;
|
||||
public storereposhaid(sha:any) {
|
||||
this.storage.setItem(this.repoIdKey,sha.toString());
|
||||
}
|
||||
public removereposhaid() {
|
||||
this.storage.removeItem(this.repoIdKey);
|
||||
}
|
||||
getreposhaid(): number {
|
||||
this.removereposhaid();
|
||||
let repoId = +this.storage.getItem(this.repoIdKey);
|
||||
return repoId;
|
||||
}
|
||||
|
||||
|
||||
//==============project_library===============//
|
||||
|
||||
// copyToLibrary(id: number): Observable<any> {
|
||||
// return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`);
|
||||
// }
|
||||
|
||||
copyFromLibrary(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`projectlibrary/copyfromprojectlibrary/${id}`);
|
||||
}
|
||||
|
||||
getallprojectLibrary(): Observable<any> {
|
||||
return this.apiRequest.get(`projectlibrary/getall_projectlibrary`);
|
||||
}
|
||||
|
||||
|
||||
addToLibrary(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`projectlibrary/copyfromrn_project/${id}`);
|
||||
}
|
||||
|
||||
getdetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Wf_library/Wf_library`);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////filters================================
|
||||
getAllSearchResults(keyword: string): Observable<any> {
|
||||
const url = `fnd/project/search/${keyword}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
|
||||
//////technology show
|
||||
getProjectTechbyId(proj_id: number): Observable<any> {
|
||||
return this.apiRequest.get(`fnd/project2/techstacks/${proj_id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActiveTechnology } from '../../models/builder/ActiveTechnology';
|
||||
import { Bcf_TechnologyStack } from '../../models/builder/Bcf_TechnologyStack';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../../services/api/api-request.service';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TechnologyStackService {
|
||||
private technologyStackURL = 'api/technology-stack';
|
||||
private technologyStackURL1='api/technology_stack1';
|
||||
private technologyStackActivateURL ='api/tech-stack-active';
|
||||
private activatedTechnologyURL ='api/active-technology';
|
||||
private updateelementurl='api/update_tech_element'
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
// get all
|
||||
// return this.apiRequest.get('api/instructors');
|
||||
// paginated data
|
||||
return this.apiRequest.get(this.technologyStackURL, params);
|
||||
|
||||
}
|
||||
|
||||
getById(id: number): Observable<any> {
|
||||
const _http = this.technologyStackURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
create(Bcf_TechnologyStack: Bcf_TechnologyStack): Observable<Bcf_TechnologyStack> {
|
||||
//`${this.baseURL}`
|
||||
return this.apiRequest.post(this.technologyStackURL, Bcf_TechnologyStack);
|
||||
}
|
||||
|
||||
// UPLOAD ZIP FILE DATA
|
||||
saveFormAndUploadFile(formData: FormData) :Observable<any> {
|
||||
return this.apiRequest.postFormData(this.technologyStackURL, formData);
|
||||
}
|
||||
// without zip data save
|
||||
saveFormAndUploadFile1(formData: FormData) :Observable<any> {
|
||||
return this.apiRequest.postFormData(this.technologyStackURL1, formData);
|
||||
}
|
||||
updateLineById(id:number,data:any){
|
||||
let _http = this.updateelementurl + "/"+id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
update(id: number, Bcf_TechnologyStack: Bcf_TechnologyStack): Observable<Bcf_TechnologyStack> {
|
||||
const _http = this.technologyStackURL + "/" + id;
|
||||
return this.apiRequest.put(_http, Bcf_TechnologyStack);
|
||||
}
|
||||
|
||||
setActive(id: any):Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
return this.apiRequest.get(this.technologyStackActivateURL, params);
|
||||
}
|
||||
|
||||
getActiveTechnology(): Observable<ActiveTechnology[]> {
|
||||
return this.apiRequest.get(this.activatedTechnologyURL);
|
||||
}
|
||||
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.technologyStackURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
////get by service type
|
||||
getByServiceType(servicetype: any): Observable<any> {
|
||||
const _http = "token/flf/tech_stack/get_byservicetype/" + servicetype;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import baseUrl from '../api/helper'
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WireframeLineService {
|
||||
|
||||
constructor(private _http: HttpClient, private apiRequest:ApiRequestService) { }
|
||||
public addToDB(line: any){
|
||||
return this._http.post(`${baseUrl}/r/create`, line);
|
||||
}
|
||||
|
||||
public getOneFromDBById(id: any){
|
||||
return this._http.get(`${baseUrl}/r/get-one/${id}`);
|
||||
}
|
||||
|
||||
public getAllLines(){
|
||||
return this._http.get(`${baseUrl}/r/get-all`);
|
||||
}
|
||||
|
||||
public updateOneLine(line: any){
|
||||
return this._http.put(`${baseUrl}/r/update`, line);
|
||||
}
|
||||
getseedetails(): Observable<any> {
|
||||
return this._http.get(`${baseUrl}/token/frontendtable/getall`);
|
||||
}
|
||||
///list builder
|
||||
getAllwireframeslistoflistbuilder(id:number):Observable<any>{
|
||||
return this._http.get(`${baseUrl}/listbuilder/lb_line/getallwireframe_table/${id}`);
|
||||
}
|
||||
|
||||
////wireframe
|
||||
getAllwireframeslist(id:number):Observable<any>{
|
||||
return this._http.get(`${baseUrl}/formdrag/wireframe/getallwireframe_table/${id}`);
|
||||
}
|
||||
/////
|
||||
|
||||
getAllwireframes(id:number,wfid:any):Observable<any>{
|
||||
return this._http.get(`${baseUrl}/formdrag/wireframe/getall_table/${id}/${wfid}`);
|
||||
}
|
||||
|
||||
getAllwireframesmodel(id:number,wfid:any,wfname:any):Observable<any>{
|
||||
return this._http.get(`${baseUrl}/formdrag/wireframe/getmodel/${id}/${wfid}/${wfname}`);
|
||||
}
|
||||
|
||||
getColumnList(projId: any, tableName: any): Observable<any> {
|
||||
const url = `${baseUrl}/formdrag/wireframe/columnlistofwireframe/${projId}/${tableName}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
|
||||
//==============wf_library===============//
|
||||
|
||||
addToLibrary(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Rn_Fb_Header } from "src/app/models/builder/Rn_Fb_Header";
|
||||
import { Rn_Fb_Lines } from "src/app/models/builder/Rn_Fb_Lines";
|
||||
import { WireFrame } from "src/app/models/builder/WireFrame";
|
||||
import { Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../api/api-request.service";
|
||||
|
||||
export interface WireFrameList {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class WireframeService {
|
||||
private wireframeBaseURL ='api/wireframe';
|
||||
private wireFrameDropDownURL = 'api/wireframe-list'
|
||||
private wireFrameLinesURL = 'api/wireframe-lines' // used in edit view form
|
||||
private uinamechangeurl='api/wireframe-uiname'
|
||||
|
||||
private wireFrameLineURL = 'api/wireframe-line' // get fbLine by id
|
||||
private copyWireFrameURL = 'api/wireframe-copy';
|
||||
private projectIdKey: string = "projectId"; // used in wireframe type component
|
||||
private moduleIdKey: string = "moduleId";
|
||||
//private editWireframeCardURL = 'wfb/newupdate/headersnew'; //update wireframe card component list
|
||||
|
||||
private storage: Storage = sessionStorage;
|
||||
constructor(
|
||||
private apiRequest: ApiRequestService
|
||||
) {}
|
||||
|
||||
public storeProjectId(projectId: number) {
|
||||
this.storage.setItem(this.projectIdKey, projectId.toString());
|
||||
}
|
||||
public removeProjectId() {
|
||||
this.storage.removeItem(this.projectIdKey);
|
||||
}
|
||||
getProjectId(): number {
|
||||
let prjId = +this.storage.getItem(this.projectIdKey);
|
||||
return prjId;
|
||||
}
|
||||
|
||||
public storeModuleId(moduleId: number) {
|
||||
this.storage.setItem(this.moduleIdKey, moduleId.toString());
|
||||
}
|
||||
public removeModuleId() {
|
||||
this.storage.removeItem(this.moduleIdKey);
|
||||
}
|
||||
getModuleId(): number {
|
||||
let modId = +this.storage.getItem(this.moduleIdKey);
|
||||
return modId;
|
||||
}
|
||||
// ====== storage finish =======
|
||||
|
||||
// ========== RB_FB_HEADER APIS =========== //
|
||||
|
||||
getAll(moduleId: number, page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
params = params.append("moduleId", moduleId.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.wireframeBaseURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<Rn_Fb_Header> {
|
||||
const _http = this.wireframeBaseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
// this is used in edit view form
|
||||
getLinesByHeaderId(id: number): Observable<WireFrame> {
|
||||
const _http = this.wireFrameLinesURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
create(fbHeader: Rn_Fb_Header,): Observable<Rn_Fb_Header> {
|
||||
//`${this.baseURL}`
|
||||
//let params: HttpParams = new HttpParams();
|
||||
// params = params.append("moduleId", moduleId.toString());
|
||||
//params = params.append("formType", formType);
|
||||
return this.apiRequest.post(this.wireframeBaseURL, fbHeader);
|
||||
}
|
||||
|
||||
update(id: number, fbHeader: Rn_Fb_Header): Observable<Rn_Fb_Header> {
|
||||
const _http = this.wireframeBaseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, fbHeader);
|
||||
}
|
||||
|
||||
wireFrameDropDown() : Observable<WireFrameList[]> {
|
||||
return this.apiRequest.get(this.wireFrameDropDownURL);
|
||||
}
|
||||
|
||||
copy(wireframeCopyForm: Object) :Observable<any> {
|
||||
return this.apiRequest.post(this.copyWireFrameURL, wireframeCopyForm);
|
||||
}
|
||||
|
||||
// ======== RN FB LINE APIS =============//
|
||||
getLineById(id: number): Observable<Rn_Fb_Lines> {
|
||||
const _http = this.wireFrameLineURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
updateLineById(id: number, fbLine: Rn_Fb_Lines): Observable<any> {
|
||||
const _http = this.wireFrameLineURL + "/" + id;
|
||||
return this.apiRequest.put(_http, fbLine);
|
||||
}
|
||||
|
||||
|
||||
// create table for only-header, header-line, only-line, multiline form
|
||||
private createTableUrl: string = 'api/createTable';
|
||||
private createHLTableUrl: string = 'api/createTableHL';
|
||||
private createMLTableUrl: string = 'api/createTableMultiline';
|
||||
createTable(headerId: number, formType: string, data: Object) {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("header_id", headerId.toString());
|
||||
|
||||
if(formType === 'header_only' || formType === 'line_only') {
|
||||
return this.apiRequest.post(this.createTableUrl, data, params);
|
||||
} else if (formType === 'header_line') {
|
||||
return this.apiRequest.post(this.createHLTableUrl, data, params);
|
||||
} else if(formType === 'multiline') {
|
||||
return this.apiRequest.post(this.createMLTableUrl, data, params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private buildMVCFormURL: string = 'api/build_wireframe';
|
||||
private buildForm: string ='api/SpringMVC_Hibernate_Mysql_Form_onlyHeader_Builder';
|
||||
private buildMVC_ML_FormURL: string = 'ml_build_form';
|
||||
// build mvc form
|
||||
buildMVCForm(formType: string, headerId: number) {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("header_id", headerId.toString());
|
||||
if(formType === 'multiline') {
|
||||
return this.apiRequest.get(this.buildMVC_ML_FormURL, params);
|
||||
} else {
|
||||
return this.apiRequest.get(this.buildMVCFormURL, params);
|
||||
// return this.apiRequest.get(this.buildForm, params);
|
||||
}
|
||||
}
|
||||
|
||||
private buildAngularFormURL: string = 'build_angular_form';
|
||||
// build angular form
|
||||
buildAngularForm(headerId: number) {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("header_id", headerId.toString());
|
||||
return this.apiRequest.get(this.buildAngularFormURL, params);
|
||||
}
|
||||
|
||||
private delete_MVC_OH_FormURL: string = 'delete_wireframe';
|
||||
private delete_MVC_OL_FormURL: string = 'delete_line_wireframe';
|
||||
private delete_MVC_HL_FormURL: string = 'delete_header_line_wireframe';
|
||||
private delete_MVC_ML_FormURL: string = 'delete_header_line_wireframe';
|
||||
deleteMVCForm(formType: string, headerId: number) {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("header_id", headerId.toString());
|
||||
if(formType === 'header_only') {
|
||||
return this.apiRequest.get(this.delete_MVC_OH_FormURL, params);
|
||||
} else if(formType === 'line_only') {
|
||||
return this.apiRequest.get(this.delete_MVC_OL_FormURL, params);
|
||||
} else if (formType === 'header_line') {
|
||||
return this.apiRequest.get(this.delete_MVC_HL_FormURL, params);
|
||||
} else if(formType === 'multiline') {
|
||||
return this.apiRequest.get(this.delete_MVC_ML_FormURL, params);
|
||||
}
|
||||
}
|
||||
|
||||
private baseURl: string = 'api';
|
||||
dynamicBuilder(headerId: number, actionLink: string) {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("header_id", headerId?.toString());
|
||||
return this.apiRequest.get("api/wireframe_builder_json_controller"+actionLink, params); // first return this.apiRequest.get("api/"+actionLink, params);
|
||||
}
|
||||
public build(Id: any){
|
||||
return this.apiRequest.get(`entityBuilder/json/${Id}`);
|
||||
}
|
||||
//============= MANUPULATE WIREFRAME PROPERTIES ===============//
|
||||
|
||||
private addNewFieldInSectionURL = 'api/wireframe-add-field-in-section';
|
||||
private addNewFieldInLineSectionURL = 'api/wireframe-add-field-in-line-section';
|
||||
private updateFieldNameURL = 'api/wireframe-update-field-name';
|
||||
private deleteSectionURL = 'api/wireframe-delete-section';
|
||||
addFieldInSection(id: number, sectionNumber: number) :Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
params = params.append("section", sectionNumber.toString());
|
||||
return this.apiRequest.get(this.addNewFieldInSectionURL, params);
|
||||
}
|
||||
|
||||
addFieldInLineSection(id: number, sectionNumber: number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
params = params.append("section", sectionNumber.toString());
|
||||
return this.apiRequest.get(this.addNewFieldInLineSectionURL, params);
|
||||
}
|
||||
|
||||
|
||||
updateFieldName(id: number, body: Rn_Fb_Lines): Observable<any> {
|
||||
let _http = this.updateFieldNameURL + "/" + id;
|
||||
return this.apiRequest.post(_http, body);
|
||||
}
|
||||
|
||||
private addSectionOrButtonURL = 'api/wireframe-add-section-button';
|
||||
addSectionOrButton(headerId, body: Object): Observable<any> {
|
||||
let _http = this.addSectionOrButtonURL + "/" + headerId;
|
||||
return this.apiRequest.post(_http, body);
|
||||
}
|
||||
|
||||
|
||||
deleteSection(headerId: number, sectionNumber: number): Observable<any> {
|
||||
let _http = this.deleteSectionURL + "/" + headerId;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("section_num", sectionNumber.toString());
|
||||
return this.apiRequest.get(_http, params);
|
||||
}
|
||||
|
||||
private deleteFieldURL = 'api/wireframe_delete_header';
|
||||
deleteField(id: number) {
|
||||
let _http = this.deleteFieldURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
updateuiname(id, data): Observable<any> {
|
||||
let _http = this.uinamechangeurl + "/" + id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
private WURL='fnd/project/count_wfline3'
|
||||
wireframecount(){
|
||||
let _http = this.WURL;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
wireframecount1(id:any){
|
||||
let _http = `fnd1/count/get_wireframe/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
reportcount(id:any){
|
||||
let _http=`fnd1/count/get_REPORT/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
actioncount(id:any){
|
||||
let _http=`fnd1/count/get_action/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
editWireframeCard(id:any, headerData:Rn_Fb_Header):Observable<Rn_Fb_Header>{
|
||||
const _http = `wfb/newupdate/headersnew/${id}`;
|
||||
return this.apiRequest.put(_http,headerData);
|
||||
}
|
||||
|
||||
getByIdWireframe(id:any){
|
||||
let _http = `api/wireframe/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
//==============wf_library===============//
|
||||
|
||||
// copyToLibrary(id: number): Observable<any> {
|
||||
// return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`);
|
||||
// }
|
||||
|
||||
copyFromLibrary(id: number, moduleId: number): Observable<any> {
|
||||
return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}/${moduleId}`);
|
||||
}
|
||||
|
||||
getdetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Wf_library/Wf_library`);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs";
|
||||
import { ApiRequestService } from "../services/api/api-request.service";
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
import { saveAs } from 'file-saver';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import baseUrl from './api/helper';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CsvService {
|
||||
private getallheadersURL = "api/csv/getallheaders";
|
||||
private SaveURL = "api/template/save";
|
||||
private downloadURL = "api/csv/download";
|
||||
private purl="api/template/demo/download";
|
||||
constructor(private apiRequest: ApiRequestService,
|
||||
private http: HttpClient) { }
|
||||
|
||||
|
||||
importCsv(file: File,data:any):Observable<any>{
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.apiRequest.postFormData(`${this.SaveURL}/${data}`,formData);
|
||||
//return this.http.post('http://localhost:9191/api/csv/save', formData);
|
||||
}
|
||||
|
||||
getAllCsv(): Observable<any>{
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
//params = params.set('file', file);
|
||||
return this.apiRequest.get(this.getallheadersURL, params);
|
||||
}
|
||||
|
||||
downloadCsv(): Observable<any>{
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
//params= params.set('file', file);
|
||||
return this.apiRequest.get(this.downloadURL, params);
|
||||
}
|
||||
|
||||
// working
|
||||
// downloadCsvsprio(data:any): void {
|
||||
// this.http.get(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_priority2_t');
|
||||
// });
|
||||
// }
|
||||
|
||||
// downloadCsvsprio(data:any): void {
|
||||
// this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_priority2_t');
|
||||
// });
|
||||
// }
|
||||
|
||||
// downloadCsvsimpa(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_impact2_t');
|
||||
// });
|
||||
// }
|
||||
// downloadCsvsurge(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_urgency_t');
|
||||
// });
|
||||
// }
|
||||
// downloadCsvscat(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_category2_t');
|
||||
// });
|
||||
// }
|
||||
// downloadCsvsstate(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_State_t');
|
||||
// });
|
||||
// }
|
||||
// downloadCsvscontact(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_Contact_type_t');
|
||||
// });
|
||||
// }
|
||||
// downloadCsvscust(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_customer_t');
|
||||
// });
|
||||
// }
|
||||
// downloadCsvshan(data:any): void {
|
||||
// this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
// saveAs(data, 'Sr_handler_t');
|
||||
// });
|
||||
// }
|
||||
|
||||
downloadCsvs(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, data+'_t');
|
||||
});
|
||||
}
|
||||
|
||||
downloadCsvsprio(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_priority2_t');
|
||||
});
|
||||
}
|
||||
downloadCsvsimpa(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_impact2_t');
|
||||
});
|
||||
}
|
||||
downloadCsvsurge(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_urgency_t');
|
||||
});
|
||||
}
|
||||
downloadCsvscat(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_category2_t');
|
||||
});
|
||||
}
|
||||
downloadCsvsstate(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_State_t');
|
||||
});
|
||||
}
|
||||
downloadCsvscontact(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_Contact_type_t');
|
||||
});
|
||||
}
|
||||
downloadCsvscust(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_customer_t');
|
||||
});
|
||||
}
|
||||
downloadCsvshan(data:any): void {
|
||||
this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => {
|
||||
saveAs(data, 'Sr_handler_t');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import * as FileSaver from 'file-saver';
|
||||
import * as XLSX from 'xlsx';
|
||||
|
||||
const EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
||||
const EXCEL_EXTENSION = '.xlsx';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ExcelService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
public exportAsExcelFile(json: any[], excelFileName: string, fileNameSuffix=''): void {
|
||||
|
||||
const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);
|
||||
const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };
|
||||
const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||
this.saveAsExcelFile(excelBuffer, excelFileName, fileNameSuffix);
|
||||
}
|
||||
|
||||
private saveAsExcelFile(buffer: any, fileName = 'export', fileNameSuffix=''): void {
|
||||
const data: Blob = new Blob([buffer], {
|
||||
type: EXCEL_TYPE
|
||||
});
|
||||
FileSaver.saveAs(data, fileName + fileNameSuffix + EXCEL_EXTENSION);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AlertsService {
|
||||
|
||||
constructor(private http: HttpClient,private apiRequest: ApiRequestService) {}
|
||||
|
||||
public saveData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`Alerts/Alerts`, data);
|
||||
}
|
||||
|
||||
public getDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`Alerts/Alerts`);
|
||||
}
|
||||
|
||||
public getDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`Alerts/Alerts/${id}`);
|
||||
}
|
||||
|
||||
public deleteById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`Alerts/Alerts/${id}`);
|
||||
}
|
||||
|
||||
public updateData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`Alerts/Alerts/${id}`, data);
|
||||
}
|
||||
|
||||
|
||||
////////// ALert Rules
|
||||
public saveRuleData(data: any): Observable<any> {
|
||||
return this.apiRequest.post(`AlertRules/AlertRules`, data);
|
||||
}
|
||||
|
||||
public getRuleDetails(): Observable<any> {
|
||||
return this.apiRequest.get(`AlertRules/AlertRules`);
|
||||
}
|
||||
|
||||
public getRuleDetailsById(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`AlertRules/AlertRules/${id}`);
|
||||
}
|
||||
|
||||
public deleteRuleById(id: number): Observable<any> {
|
||||
return this.apiRequest.delete(`AlertRules/AlertRules/${id}`);
|
||||
}
|
||||
|
||||
public updateRuleData(data: any, id: number): Observable<any> {
|
||||
return this.apiRequest.put(`AlertRules/AlertRules/${id}`, data);
|
||||
}
|
||||
|
||||
///get table form store
|
||||
public getTablefromstore(id: number): Observable<any> {
|
||||
return this.apiRequest.get(`AlertRules/tablelist/${id}`);
|
||||
}
|
||||
|
||||
///get column form store
|
||||
public getColumnfromstore(id: number, tableName:string): Observable<any> {
|
||||
return this.apiRequest.get(`AlertRules/columnlist/${id}/${tableName}`);
|
||||
}
|
||||
|
||||
public getColumnfromurl(url: any): Observable<any> {
|
||||
return this.apiRequest.get(`chart/getAllKeys?apiUrl=${url}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import baseUrl from '../api/helper';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BulkimportService {
|
||||
private URL = environment.backendUrl;
|
||||
constructor(private http: HttpClient,private apiRequest: ApiRequestService) { }
|
||||
|
||||
public saveData(data: any): Observable<any> {
|
||||
return this.http.post(`${baseUrl}/BulkUpload/BulkUpload`, data);
|
||||
}
|
||||
|
||||
public getDetails(): Observable<any> {
|
||||
return this.http.get(`${baseUrl}/BulkUpload/BulkUpload`);
|
||||
}
|
||||
|
||||
public getDetailsById(id: number): Observable<any> {
|
||||
return this.http.get(`${baseUrl}/BulkUpload/BulkUpload/${id}`);
|
||||
}
|
||||
|
||||
public deleteById(id: number): Observable<any> {
|
||||
return this.http.delete(`${baseUrl}/BulkUpload/BulkUpload/${id}`);
|
||||
}
|
||||
|
||||
public updateData(data: any, id: number): Observable<any> {
|
||||
return this.http.put(`${baseUrl}/BulkUpload/BulkUpload/${id}`, data);
|
||||
}
|
||||
|
||||
|
||||
//rule
|
||||
condition:string = '';
|
||||
setCondition(condition: string) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
getCondition(): string {
|
||||
return this.condition;
|
||||
}
|
||||
|
||||
getSheetName(id: number): Observable<any>{
|
||||
return this.apiRequest.get(`api/BulkUpload/sheet/${id}`);
|
||||
}
|
||||
|
||||
convertFileToJson(id: number): Observable<any> {
|
||||
return this.apiRequest.post(`api/BulkUpload/templatetojson/${id}`, {});
|
||||
}
|
||||
|
||||
// getTemplateById(id: number): Observable<any> {
|
||||
// const url = `api/template/gettemplatebyid/${id}`;
|
||||
// return this.apiRequest.get(url);
|
||||
// }
|
||||
|
||||
getHeader(id: number): Observable<any> {
|
||||
const url = `api/BulkUpload/getHeaders/${id}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
getColumnNames(tableName: string): Observable<any> {
|
||||
const url = `api/BulkUpload/columns/${tableName}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
changeKeysOfJson(updatedKeyJson: string, oldKeyDataJson:any): Observable<any> {
|
||||
const formData:FormData=new FormData();
|
||||
formData.append("updatedKeyJson",updatedKeyJson);
|
||||
formData.append("oldKeyDataJson",oldKeyDataJson);
|
||||
return this.apiRequest.postFormData(`api/BulkUpload/jsonkeychange`, formData);
|
||||
}
|
||||
|
||||
downloadExcel(id: string, jsonData:any, ruleData:any): Observable<any> {
|
||||
// return this.apiRequest.post(`api/dynamic/DownloadExcel/${tableName}`, data);
|
||||
jsonData = JSON.stringify(jsonData);
|
||||
ruleData = JSON.stringify(ruleData);
|
||||
const formData:FormData=new FormData();
|
||||
formData.append("jsonData",jsonData);
|
||||
formData.append("ruleData",ruleData);
|
||||
const url = `${this.URL}/api/BulkUpload/DownloadExcel/${id}`;
|
||||
return this.apiRequest.postFormData(`api/BulkUpload/DownloadExcel/${id}`, formData);
|
||||
// return this.http.post(url, formData, { responseType: 'blob' }).pipe(
|
||||
// map((response: Blob) => {
|
||||
// // Process the response as needed
|
||||
// return response;
|
||||
// })
|
||||
// );
|
||||
}
|
||||
|
||||
////for download
|
||||
getSheet(id: number): Observable<any> {
|
||||
const url = `${this.URL}/api/BulkUpload/downloadImportStatement/${id}`;
|
||||
// return this.apiRequest.get(url);
|
||||
return this.http.get(url, { responseType: 'blob' }).pipe(
|
||||
map((response: Blob) => {
|
||||
// Process the response as needed
|
||||
return response;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
///////////////////////
|
||||
//mapping rules
|
||||
public saveMappingData(data: any): Observable<any> {
|
||||
return this.http.post(`${baseUrl}/MappingRule/MappingRule`, data);
|
||||
}
|
||||
|
||||
public getMappingDetails(): Observable<any> {
|
||||
return this.http.get(`${baseUrl}/MappingRule/MappingRule`);
|
||||
}
|
||||
|
||||
public getMappingDetailsById(id: number): Observable<any> {
|
||||
return this.http.get(`${baseUrl}/MappingRule/MappingRule/${id}`);
|
||||
}
|
||||
|
||||
public deleteMappingById(id: number): Observable<any> {
|
||||
return this.http.delete(`${baseUrl}/MappingRule/MappingRule/${id}`);
|
||||
}
|
||||
|
||||
public updateMappingData(data: any, id: number): Observable<any> {
|
||||
return this.http.put(`${baseUrl}/MappingRule/MappingRule/${id}`, data);
|
||||
}
|
||||
|
||||
getDDforMappingRule(excelFile:any, sheetName:string){
|
||||
console.log(sheetName,excelFile)
|
||||
const formData:FormData=new FormData();
|
||||
formData.append("excelFile",excelFile);
|
||||
formData.append("sheetName",sheetName);
|
||||
return this.apiRequest.postFormData(`MappingRule/getHeaders`, formData);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////
|
||||
// master
|
||||
|
||||
mastergetexcelSheet(file_type: string): Observable<any> {
|
||||
const url = `masterimport/demo/download/${file_type}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
masterdownloadExcel(id: string, jsonData:any,): Observable<any> {
|
||||
jsonData = JSON.stringify(jsonData);
|
||||
const formData:FormData=new FormData();
|
||||
formData.append("jsonData",jsonData);
|
||||
return this.apiRequest.postFormData(`masterimport/DownloadExcelForMaster/${id}`, formData);
|
||||
}
|
||||
|
||||
mastergetSheetName(id: number): Observable<any>{
|
||||
return this.apiRequest.get(`masterimport/sheet/${id}`);
|
||||
}
|
||||
|
||||
mastergetColumnNames(tableName: string): Observable<any> {
|
||||
const url = `masterimport/columns/${tableName}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CodeExtractionService } from './code-extraction.service';
|
||||
|
||||
describe('CodeExtractionService', () => {
|
||||
let service: CodeExtractionService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(CodeExtractionService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,184 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
|
||||
|
||||
import { Bcf_Extractor } from 'src/app/models/fnd/Bcf_Extractor';
|
||||
import { Bcf_Extractor_Params } from 'src/app/models/fnd/Bcf_Extractor_Params';
|
||||
import { FileData } from 'src/app/models/builder/FileData';
|
||||
import { FileDetails } from 'src/app/models/builder/FileDetails';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CodeExtractionService {
|
||||
private codeExtractionURL = 'api/bcf-extractor';
|
||||
private codeExtractionParamsURL = 'api/bcf-extractor-params';
|
||||
private staticCodeExtractionURL = 'api/static_code_extraction';
|
||||
private dynamicCodeExtractionURL = 'api/dynamic_code_extraction';
|
||||
private buildMasterBuilderURL = 'api/build_master_builder';
|
||||
private extractionStatusChangeURL = 'api/bcf-extractor-params/extraction-status-change';
|
||||
private creationStatusChangeURL = 'api/bcf-extractor-params/creation-status-change';
|
||||
private codeExtractionBuilderURL = 'codeextractor/builderfile';
|
||||
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
// get all
|
||||
// return this.apiRequest.get('api/instructors');
|
||||
// paginated data
|
||||
return this.apiRequest.get(this.codeExtractionURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<Bcf_Extractor> {
|
||||
const _http = this.codeExtractionURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
create(bcf_extractor: Bcf_Extractor): Observable<Bcf_Extractor> {
|
||||
//`${this.baseURL}`
|
||||
return this.apiRequest.post(this.codeExtractionURL, bcf_extractor);
|
||||
}
|
||||
|
||||
// UPLOAD ZIP FILE DATA
|
||||
saveFormAndUploadFile(formData: FormData) :Observable<any> {
|
||||
//return this.http.post(this.appConfig.baseApiPath + this.codeExtractionURL, formData, { reportProgress:true, observe: 'events' });
|
||||
return this.apiRequest.postFormData(this.codeExtractionURL, formData);
|
||||
}
|
||||
delete1(id: number): Observable<any> {
|
||||
const _http = this.codeExtractionURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
update(id: number, bcf_extractor: Bcf_Extractor): Observable<Bcf_Extractor> {
|
||||
const _http = this.codeExtractionURL + "/" + id;
|
||||
return this.apiRequest.put(_http, bcf_extractor);
|
||||
}
|
||||
|
||||
// =========== CODE EXTRACTION PARAMS ===============
|
||||
|
||||
getCodeExtractionParamById(id: number): Observable<Bcf_Extractor_Params> {
|
||||
const _http = this.codeExtractionParamsURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
getCodeExtractionParams(header_id: number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('header_id', header_id.toString());
|
||||
return this.apiRequest.get(this.codeExtractionParamsURL, params);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.codeExtractionParamsURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
createExtractionParams(header_id: number, bcf_extractor_params: Bcf_Extractor_Params): Observable<Bcf_Extractor_Params> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('header_id', header_id.toString());
|
||||
return this.apiRequest.post(this.codeExtractionParamsURL, bcf_extractor_params, params);
|
||||
}
|
||||
|
||||
updateExtractionParams(id: number, header_id: number, bcf_extractor_params: Bcf_Extractor_Params): Observable<Bcf_Extractor_Params> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('header_id', header_id.toString());
|
||||
const _http = this.codeExtractionParamsURL + "/" + id;
|
||||
return this.apiRequest.put(_http, bcf_extractor_params, params);
|
||||
}
|
||||
updatecodeparam(id:any,bcf_extractor_params: Bcf_Extractor_Params):Observable<Bcf_Extractor_Params>{
|
||||
const _http = this.codeExtractionParamsURL + "/" + id;
|
||||
return this.apiRequest.put(_http, bcf_extractor_params, );
|
||||
}
|
||||
// CREATION STATUS CHANGE
|
||||
|
||||
creationStatusChange(id: number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
return this.apiRequest.get(this.creationStatusChangeURL, params);
|
||||
}
|
||||
// EXTRACTION STATUS CHANGE
|
||||
extractionStatusChange(id: number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
return this.apiRequest.get(this.extractionStatusChangeURL, params);
|
||||
}
|
||||
// STATIC CODE EXTRACTOPN AND DYNAMIC CODE EXTRACTION
|
||||
staticCodeExtraction(id:number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('header_id', id.toString());
|
||||
return this.apiRequest.get(this.staticCodeExtractionURL, params);
|
||||
}
|
||||
dynamicCodeExtraction(id:number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('header_id', id.toString());
|
||||
return this.apiRequest.get(this.dynamicCodeExtractionURL, params);
|
||||
}
|
||||
|
||||
// BUILD MASTER BUILDER
|
||||
buildMasterBuilder(id: number): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('id', id.toString());
|
||||
return this.apiRequest.get(this.buildMasterBuilderURL, params);
|
||||
}
|
||||
|
||||
// ========== code editor service =======
|
||||
|
||||
private codeExtractorFileListURL = 'api/bcf-extractor-file-list';
|
||||
private fileReadURL = 'api/file-code-read';
|
||||
private fileCodeSaveURL = 'api/file-code-save';
|
||||
|
||||
getFileList(id: number): Observable<any> {
|
||||
const _http = this.codeExtractorFileListURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
|
||||
}
|
||||
|
||||
readFile(id: number): Observable<FileData> {
|
||||
const _http = this.fileReadURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
saveCodeIntoFile(fileData: FileData): Observable<any> {
|
||||
return this.apiRequest.post(this.fileCodeSaveURL, fileData);
|
||||
}
|
||||
|
||||
// ======= STATIC CODE READ AND SAVE ========== //
|
||||
private staticFileReadURL = 'api/static-file-code-read';
|
||||
private SstaticFileCodeSaveURL = 'api/static-file-code-save';
|
||||
readStaticFile(id: number): Observable<FileData> {
|
||||
const _http = this.staticFileReadURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
saveCodeIntoStaticFile(fileData: FileData): Observable<any> {
|
||||
return this.apiRequest.post(this.SstaticFileCodeSaveURL, fileData);
|
||||
}
|
||||
|
||||
// ======= CODE EXTRACTION BUILDER ========== //
|
||||
getCodeExtractionBuilderById(id: number): Observable<any> {
|
||||
// const _http = this.codeExtractionBuilderURL + "/" + id;
|
||||
return this.apiRequest.get(`${this.codeExtractionBuilderURL}/getbyid/${id}`);
|
||||
}
|
||||
|
||||
getAllFileById(id: number):Observable<any>{
|
||||
const url = `${this.codeExtractionBuilderURL}/get_allfile/${id}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
deleteBuiilderFile(id: number): Observable<any> {
|
||||
const _http = `${this.codeExtractionBuilderURL}/deletefile/${id}`;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
readBuidlerFile(id: number): Observable<FileDetails> {
|
||||
const _http = `${this.codeExtractionBuilderURL}/readfile/${id}`;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
saveBuidlerFile(fileDetails: FileDetails): Observable<any> {
|
||||
return this.apiRequest.post('codeextractor/builderfile/savefile', fileDetails);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DataflowService {
|
||||
// baseurl = environment.surejobUrl;
|
||||
private addDataURl = 'api/suredata';
|
||||
constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/dataflow/dataflow`);
|
||||
}
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/dataflow/dataflow`, data);
|
||||
}
|
||||
create1(data:any,files:any): Observable<any> {
|
||||
const s = JSON.stringify(data);
|
||||
const formData:FormData = new FormData();
|
||||
formData.append("data",s);
|
||||
formData.append("ssh_file_key",files);
|
||||
// for(let i=0;i<files.length;i++){
|
||||
// console.log("here");
|
||||
// formData.append(files[i].name,files[i]);
|
||||
// }
|
||||
//console.log(formData.get("attachmentFile0"))
|
||||
return this.apiRequest.postFormData(this.addDataURl,formData);
|
||||
|
||||
// return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
public getById(id: any){
|
||||
return this._http.get(`${baseUrl}/dataflow/dataflow/${id}`);
|
||||
}
|
||||
public getsourcedata(id: number):Observable<any>{
|
||||
return this._http.get(`${baseUrl}/suredata/suredataflow/tablelistfromsource/${id}`);
|
||||
}
|
||||
public getstoredata(id:number):Observable<any>{
|
||||
return this._http.get(`${baseUrl}/suredata/suredataflow/tablelistfromstore/${id}`);
|
||||
}
|
||||
public delete(id:any){
|
||||
return this._http.delete(`${baseUrl}/dataflow/dataflow/${id}`);
|
||||
}
|
||||
|
||||
public update(id:any,data:any){
|
||||
return this._http.put(`${baseUrl}/dataflow/dataflow/${id}`, data);
|
||||
}
|
||||
public updatelines(id:any,data:any){
|
||||
return this._http.put(`${baseUrl}/dataflow/dataflow_line/update/${id}`,data);
|
||||
}
|
||||
// public getdataflowlines(){
|
||||
// return this._http.get(`${baseUrl}/dataflow/dataflow_line/getall`);
|
||||
// }
|
||||
|
||||
|
||||
condition:string = '';
|
||||
setCondition(condition: string) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
getCondition(): string {
|
||||
return this.condition;
|
||||
}
|
||||
|
||||
datacondition: string = '';
|
||||
setDataCondition(condition: string) {
|
||||
this.datacondition = condition;
|
||||
}
|
||||
|
||||
getDataCondition(): string {
|
||||
return this.datacondition;
|
||||
}
|
||||
|
||||
|
||||
public createjob(id:any):Observable<any> {
|
||||
return this._http.get(`${baseUrl}/token/suredata/surejob/create_job/${id}`);
|
||||
}
|
||||
//surebilljob
|
||||
// public getAllsurejob(line_id:any) {
|
||||
// return this._http.get(`${this.baseurl}/surebilljob/getalljob/${line_id}`);
|
||||
// }
|
||||
// public createsceduler(data: any){
|
||||
// return this._http.post(`${this.baseurl}/surebilljob/schedule`, data);
|
||||
// }
|
||||
// public updatesurejob(data: any){
|
||||
// return this._http.post(`${this.baseurl}/surebilljob/schedule`, data);
|
||||
// }
|
||||
// public pause(data:any){
|
||||
// return this._http.post(`${this.baseurl}/surebilljob/pauseschedule`, data);
|
||||
// }
|
||||
// public runonce(data:any){
|
||||
// return this._http.post(`${this.baseurl}/surebilljob/runschedule`, data);
|
||||
// }
|
||||
// public resume(data:any){
|
||||
// return this._http.post(`${this.baseurl}/surebilljob/resumeschedule`, data);
|
||||
// }
|
||||
// public deletesurejob(val:any){
|
||||
// return this._http.delete(`${this.baseurl}/surebilljob/deleteschedule/${val}`,);
|
||||
// }
|
||||
|
||||
/////////////// data flow 3 ///////////////
|
||||
|
||||
getColumnListFromSourceTable(id: number, tableName: string): Observable<any> {
|
||||
return this.apiRequest.get(`suredata/suredataflow3/columnlistfromSource/${id}/${tableName}`);
|
||||
}
|
||||
getColumnListFromStoreTable(id: number, tableName: string): Observable<any> {
|
||||
return this.apiRequest.get(`suredata/suredataflow3/columnlistfromStore/${id}/${tableName}`);
|
||||
}
|
||||
/////cron jobs //////////////
|
||||
buildCronJob(minutes: string, hours: string, dayOfMonth: string, month: string, dayOfWeek: string): string {
|
||||
const cronJobString = `${minutes} ${hours} ${dayOfMonth} ${month} ${dayOfWeek}`;
|
||||
return cronJobString;
|
||||
}
|
||||
|
||||
|
||||
///////////data flow table name by store name//////////
|
||||
getTableListFromStoreByName(name: string): Observable<any> {
|
||||
const url = `${baseUrl}/suredata/suredataflow/tablelistfromstoreByname/${name}`;
|
||||
return this._http.get(url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DatamanagementService {
|
||||
private URL = environment.backendUrl;
|
||||
private updateUrl = "api/template/dynamic/dynamic_temp"
|
||||
constructor(private apiRequest: ApiRequestService, private _http: HttpClient) { }
|
||||
getall() {
|
||||
return this.apiRequest.get(`api/template/getalltemplate`);
|
||||
}
|
||||
|
||||
// getallentity(){
|
||||
// return this.apiRequest.get(`api/template/databasequery/Table_list_all`);
|
||||
// }
|
||||
|
||||
getTemplateById(id: number): Observable<any> {
|
||||
const url = `api/template/gettemplatebyid/${id}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
getHeader(id: number): Observable<any> {
|
||||
const url = `api/dynamic/getHeaders/${id}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
getColumnNames(tableName: string): Observable<any> {
|
||||
const url = `api/dynamic/columns/${tableName}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
// create(data:any,files:any): Observable<any> {
|
||||
// const s = JSON.stringify(data);
|
||||
// const formData:FormData = new FormData();
|
||||
// formData.append("data",s);
|
||||
// formData.append("file",files);
|
||||
|
||||
// return this.apiRequest.postFormData(`sureserve/template/dynamic/dynamic_temp`,formData);
|
||||
// }
|
||||
|
||||
create(file: any, fileType: string): Observable<any> {
|
||||
const formData: FormData = new FormData();
|
||||
formData.append('file', file);
|
||||
// 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<any> {
|
||||
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) {
|
||||
return this.apiRequest.delete(`api/template/deletetemplate/${id}`);
|
||||
}
|
||||
|
||||
// getjson(){
|
||||
// return this.apiRequest.get(`api/dynamic/jsonkeychange`);
|
||||
// }
|
||||
|
||||
changeKeysOfJson(newjson: string, body: any): Observable<any> {
|
||||
// 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);
|
||||
return this.apiRequest.postFormData(`api/dynamic/jsonkeychange`, formData);
|
||||
}
|
||||
|
||||
|
||||
saveTemplateInJson(id: any): Observable<any> {
|
||||
// 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<any> {
|
||||
return this.apiRequest.post(`api/dynamic/templatetojson/${id}`, {});
|
||||
}
|
||||
|
||||
|
||||
downloadExcel(tableName: string, data: any): Observable<any> {
|
||||
// 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;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import baseUrl from 'src/app/services/api/helper';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DatastoreService {
|
||||
private addDataURl = 'api/suredata';
|
||||
private addDataURl1='api/suredatasource';
|
||||
constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { }
|
||||
public getAll() {
|
||||
return this._http.get(`${baseUrl}/api/suredata`);
|
||||
}
|
||||
public create(data: any){
|
||||
return this._http.post(`${baseUrl}/api/suredata`, data);
|
||||
}
|
||||
create1(data:any,files:any): Observable<any> {
|
||||
const s = JSON.stringify(data);
|
||||
const formData:FormData = new FormData();
|
||||
formData.append("data",s);
|
||||
formData.append("ssh_file_key",files);
|
||||
// for(let i=0;i<files.length;i++){
|
||||
// console.log("here");
|
||||
// formData.append(files[i].name,files[i]);
|
||||
// }
|
||||
//console.log(formData.get("attachmentFile0"))
|
||||
return this.apiRequest.postFormData(this.addDataURl,formData);
|
||||
|
||||
// return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
public getById(id: any){
|
||||
return this._http.get(`${baseUrl}/api/suredata/${id}`);
|
||||
}
|
||||
public delete(id:any){
|
||||
return this._http.delete(`${baseUrl}/api/suredata/${id}`);
|
||||
}
|
||||
|
||||
public update(id:any,data:any){
|
||||
return this._http.put(`${baseUrl}/api/suredata/${id}`, data);
|
||||
}
|
||||
update1(id: number, data:any,files:any): Observable<any> {
|
||||
const s =JSON.stringify(data);
|
||||
const formData:FormData=new FormData();
|
||||
formData.append("data",s);
|
||||
formData.append("ssh_file_key",files);
|
||||
|
||||
return this.apiRequest.postFormData(`${this.addDataURl}/${id}`,formData);
|
||||
|
||||
|
||||
}
|
||||
public getAll2() {
|
||||
return this._http.get(`${baseUrl}/api/suredatasource`);
|
||||
}
|
||||
|
||||
create2(data:any,files:any): Observable<any> {
|
||||
const s = JSON.stringify(data);
|
||||
const formData:FormData = new FormData();
|
||||
formData.append("data",s);
|
||||
formData.append("ssh_file_key",files);
|
||||
// for(let i=0;i<files.length;i++){
|
||||
// console.log("here");
|
||||
// formData.append(files[i].name,files[i]);
|
||||
// }
|
||||
//console.log(formData.get("attachmentFile0"))
|
||||
return this.apiRequest.postFormData(this.addDataURl1,formData);
|
||||
|
||||
// return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
public getById2(id: any){
|
||||
return this._http.get(`${baseUrl}/api/suredatasource/${id}`);
|
||||
}
|
||||
public delete2(id:any){
|
||||
return this._http.delete(`${baseUrl}/api/suredatasource/${id}`);
|
||||
}
|
||||
|
||||
|
||||
update2(id: number, data:any,files:any): Observable<any> {
|
||||
const s =JSON.stringify(data);
|
||||
const formData:FormData=new FormData();
|
||||
formData.append("data",s);
|
||||
formData.append("ssh_file_key",files);
|
||||
|
||||
return this.apiRequest.postFormData(`${this.addDataURl1}/${id}`,formData);
|
||||
}
|
||||
|
||||
testConnection(databaseType: string, storeUsername: string, storePassword: string, portNumber: string, dbHostname: string, databasename): Observable<any>{
|
||||
const url = 'suredata/test/testconnection';
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("database_type",databaseType);
|
||||
params =params.append("store_username",storeUsername);
|
||||
params =params.append("store_password",storePassword);
|
||||
params =params.append("portnumber",portNumber);
|
||||
params =params.append("dbhostname",dbHostname);
|
||||
params =params.append("database_name",databasename)
|
||||
return this.apiRequest.get(url, params);
|
||||
}
|
||||
|
||||
testsshConnection(sshHost: string, sshUsername: string, sshPassword: string, sshKeyFile: any): Observable<any>{
|
||||
const url = 'suredata/test/checksshconnection';
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("sshHost",sshHost);
|
||||
params =params.append("sshUsername",sshUsername);
|
||||
params =params.append("sshPassword",sshPassword);
|
||||
params =params.append("sshKeyFile",sshKeyFile);
|
||||
return this.apiRequest.post(url, params);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ExceptionRuleLibraryService } from './exception-rule-library.service';
|
||||
|
||||
describe('ExceptionRuleLibraryService', () => {
|
||||
let service: ExceptionRuleLibraryService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ExceptionRuleLibraryService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Bcf_Exception_Rule_Library } from 'src/app/models/fnd/Bcf_Exception_Rule_Library ';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ExceptionRuleLibraryService {
|
||||
private exceptionRuleLibraryBaseURL = 'codeextractor/exception/exception';
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
getAll(): Observable<Bcf_Exception_Rule_Library> {
|
||||
return this.apiRequest.get(this.exceptionRuleLibraryBaseURL);
|
||||
//Create Request URL params
|
||||
// let params: HttpParams = new HttpParams();
|
||||
// params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
// params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
// return this.apiRequest.get(this.exceptionRuleLibraryBaseURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<Bcf_Exception_Rule_Library> {
|
||||
const _http = this.exceptionRuleLibraryBaseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
save(exception_rule: Bcf_Exception_Rule_Library): Observable<Bcf_Exception_Rule_Library> {
|
||||
return this.apiRequest.post(this.exceptionRuleLibraryBaseURL, exception_rule);
|
||||
}
|
||||
|
||||
update(id: number, exception_rule: Bcf_Exception_Rule_Library): Observable<Bcf_Exception_Rule_Library> {
|
||||
const _http = this.exceptionRuleLibraryBaseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, exception_rule);
|
||||
}
|
||||
|
||||
delete(id: number): Observable<Bcf_Exception_Rule_Library> {
|
||||
const _http = this.exceptionRuleLibraryBaseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
import { HttpParams} from "@angular/common/http";
|
||||
import { ExtensionField } from 'src/app/models/fnd/ExtensionField';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ExtensionService {
|
||||
private extensionAPI = 'api/extension';
|
||||
private extensionBuildAPI = 'api/extension_build';
|
||||
private lookupAPI = 'api/lookup_values';
|
||||
private dataTypeAPI = 'api/datatypes';
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
|
||||
getAll(page?:number, size?:number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('page', typeof page === "number"? page.toString():"0");
|
||||
params = params.append('size', typeof size === "number"? size.toString():"1000");
|
||||
return this.apiRequest.get(this.extensionAPI, params);
|
||||
|
||||
}
|
||||
|
||||
getById(id: number) :Observable<ExtensionField> {
|
||||
return this.apiRequest.get(this.extensionAPI + '/' + id);
|
||||
|
||||
}
|
||||
|
||||
create(extensionField: Object) :Observable<ExtensionField> {
|
||||
//`${this.baseURL}`
|
||||
return this.apiRequest.post(this.extensionAPI, extensionField);
|
||||
|
||||
}
|
||||
|
||||
update(id: number, extensionField: ExtensionField) :Observable<ExtensionField> {
|
||||
return this.apiRequest.put(this.extensionAPI + "/" + id, extensionField);
|
||||
}
|
||||
|
||||
// http://localhost:9119/api/extension_build?account_id=admin&form_code=teacher_form
|
||||
// build extension
|
||||
buildExtension(id:any, account_id?:any, form_code?:any): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append('account_id', account_id.toString());
|
||||
params = params.append('form_code', form_code.toString());
|
||||
|
||||
const url = `api/extension_build/${id}`
|
||||
return this.apiRequest.get(url, params);
|
||||
}
|
||||
|
||||
// look up code (attribute, flex)
|
||||
getLookupValues() :Observable<any> {
|
||||
return this.apiRequest.get(this.lookupAPI);
|
||||
}
|
||||
|
||||
// datatypes code (string, varchar, int etc)
|
||||
getDataTypeValues() :Observable<any> {
|
||||
return this.apiRequest.get(this.dataTypeAPI);
|
||||
}
|
||||
delete(id:any){
|
||||
return this.apiRequest.delete(`api/extension/${id}`);
|
||||
}
|
||||
|
||||
|
||||
|
||||
///extension build json object
|
||||
|
||||
getDetailsByFormCode(formCode: string): Observable<any> {
|
||||
const url = `FromExtensionJsonExtensionJson/${formCode}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
|
||||
getJsonObjectsByFormCodeList(formCode: string): Observable<any> {
|
||||
const url = `FromExtensionJson/ListExtensionJson/${formCode}`;
|
||||
return this.apiRequest.get(url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RuleLibraryService } from './rule-library.service';
|
||||
|
||||
describe('RuleLibraryService', () => {
|
||||
let service: RuleLibraryService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(RuleLibraryService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
// import { Injectable } from '@angular/core';
|
||||
|
||||
// @Injectable({
|
||||
// providedIn: 'root'
|
||||
// })
|
||||
// export class RuleLibraryService {
|
||||
|
||||
// constructor() { }
|
||||
// }
|
||||
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Bcf_Rule_Library } from 'src/app/models/fnd/Bcf_Rule_Library';
|
||||
import { RuleCopy, Rule } from 'src/app/models/fnd/RuleCopy';
|
||||
import { ApiRequestService } from '../api/api-request.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RuleLibraryService {
|
||||
private ruleLibraryBaseURL = 'code_extractor/rule_keyword/Rule_library_keyword';
|
||||
private copyRuleURL = 'api/rule-copy';
|
||||
private keywordurl='codeextractor/rulelib_new/rule_keyword1';
|
||||
private filedurl='codeextractor/rulelib_new/rule_keyword';
|
||||
private copyURL = 'code_extractor/rule_keyword/copyrule'
|
||||
constructor(private apiRequest: ApiRequestService) { }
|
||||
|
||||
copy(data: RuleCopy) {
|
||||
return this.apiRequest.post(this.copyRuleURL, data);
|
||||
}
|
||||
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
//Create Request URL params
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
return this.apiRequest.get(this.ruleLibraryBaseURL, params);
|
||||
}
|
||||
|
||||
getById(id: number): Observable<Bcf_Rule_Library> {
|
||||
const _http = this.ruleLibraryBaseURL + "/" + id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
save(rule: Bcf_Rule_Library): Observable<Bcf_Rule_Library> {
|
||||
return this.apiRequest.post(this.ruleLibraryBaseURL, rule);
|
||||
}
|
||||
|
||||
update(id: number, rule: Bcf_Rule_Library): Observable<Bcf_Rule_Library> {
|
||||
const _http = this.ruleLibraryBaseURL + "/" + id;
|
||||
return this.apiRequest.put(_http, rule);
|
||||
}
|
||||
delete(id: number): Observable<any> {
|
||||
const _http = this.ruleLibraryBaseURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
keyword(id: number,keyword: any): Observable<any> {
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
params= params.append("keyword",keyword);
|
||||
return this.apiRequest.get(this.keywordurl, params);
|
||||
}
|
||||
|
||||
insertfile(id:any,data:any,keyword:any,){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("id", id.toString());
|
||||
params= params.append("selectedarea",data);
|
||||
params= params.append("keyword",keyword);
|
||||
console.log(params);
|
||||
return this.apiRequest.get(this.filedurl, params);
|
||||
}
|
||||
|
||||
copyRule(technologyStack: string, objectType: string, subObjectType: string, service: string, newTechStackName: string, rule: Rule){
|
||||
let params: HttpParams = new HttpParams();
|
||||
params =params.append("technology_stack",technologyStack);
|
||||
params =params.append("object_type",objectType);
|
||||
params =params.append("sub_object_type",subObjectType);
|
||||
params =params.append("service",service),
|
||||
params=params.append("new_tech_stack_name",newTechStackName)
|
||||
return this.apiRequest.post(this.copyURL,rule,params);
|
||||
//return this.apiRequest.post(this.copydeployurl,params);
|
||||
//return this.http.get(`${baseUrl}/api/getmodulename`,params);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WorkflowDataService } from './workflow-data.service';
|
||||
|
||||
describe('WorkflowDataService', () => {
|
||||
let service: WorkflowDataService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(WorkflowDataService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http";
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiRequestService } from "src/app/services/api/api-request.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WorkflowDataService {
|
||||
private getAllURL = 'work';
|
||||
private addDataURl = 'work';
|
||||
private editDataURL = 'work';
|
||||
private deleteURL ='work';
|
||||
private getByIdURL = 'work';
|
||||
private updateWorkflowURL = 'updateByid';
|
||||
private fileurl ='/sureops/createfile';
|
||||
private callurl='workflow/workflow/callworkflow'
|
||||
constructor(private _http: HttpClient,
|
||||
private apiRequest: ApiRequestService) { }
|
||||
getAll(page?: number, size?: number): Observable<any> {
|
||||
// create Request URL params
|
||||
let me = this;
|
||||
let params: HttpParams = new HttpParams();
|
||||
params = params.append("page", typeof page === "number" ? page.toString() : "0");
|
||||
params = params.append("size", typeof size === "number" ? size.toString() : "1000");
|
||||
// params = params.append("module_id", module_id.toString());
|
||||
// get all
|
||||
return this.apiRequest.get(this.getAllURL, params);
|
||||
}
|
||||
getcallall(){
|
||||
return this.apiRequest.get(this.callurl);
|
||||
}
|
||||
create(data:any): Observable<any>
|
||||
{
|
||||
return this.apiRequest.post(this.addDataURl, data);
|
||||
}
|
||||
|
||||
delete(id:number){
|
||||
let _http = this.deleteURL + "/" + id;
|
||||
return this.apiRequest.delete(_http);
|
||||
}
|
||||
|
||||
getById(id:number)
|
||||
{
|
||||
let _http = this.getByIdURL + "/"+id;
|
||||
return this.apiRequest.get(_http);
|
||||
}
|
||||
|
||||
updateLineById(id:number,data:any)
|
||||
{
|
||||
let _http = this.updateWorkflowURL + "/"+id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
|
||||
update(id:number,data:any)
|
||||
{
|
||||
let _http = this.editDataURL + "/"+id;
|
||||
return this.apiRequest.put(_http,data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { UserInfoService } from './user-info.service';
|
||||
|
||||
@Injectable()
|
||||
export class JwtInterceptor implements HttpInterceptor {
|
||||
constructor(private userInfoService: UserInfoService) {}
|
||||
|
||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
// add authorization header with jwt token if available
|
||||
let currentUser = this.userInfoService.getUserInfo();
|
||||
if (currentUser && currentUser.token) {
|
||||
request = request.clone({
|
||||
setHeaders: {
|
||||
Authorization: `Bearer ${currentUser.token}`
|
||||
}
|
||||
});
|
||||
}
|
||||
return next.handle(request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MainService } from './main.service';
|
||||
|
||||
describe('MainService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: MainService = TestBed.get(MainService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { JwtHelperService } from '@auth0/angular-jwt';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MainService {
|
||||
token = sessionStorage.getItem('token');
|
||||
jwtHelper: JwtHelperService = new JwtHelperService();
|
||||
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
getIP() {
|
||||
return this.http.get(`https://api.ipify.org?format=json`)
|
||||
.toPromise()
|
||||
.then(result => result)
|
||||
.catch(error => error);
|
||||
}
|
||||
|
||||
getUser() {
|
||||
// return this.http.get(`${this.url}/get-annouce/${month}/${year}`)
|
||||
return this.http.get(`https://randomuser.me/api/?results=100`)
|
||||
.toPromise()
|
||||
.then(result => result)
|
||||
.catch(error => error);
|
||||
}
|
||||
|
||||
getUserTest() {
|
||||
return this.http.get(`https://randomuser.me/api/?results=100`)
|
||||
.toPromise()
|
||||
.then(result => result)
|
||||
.catch(error => error);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export enum NotificationType {
|
||||
Warning = <any>"warning",
|
||||
Info = <any>"info",
|
||||
Danger = <any>"danger"
|
||||
}
|
||||
|
||||
export class Notification {
|
||||
constructor(
|
||||
public readonly type: NotificationType,
|
||||
public readonly message: string,
|
||||
public readonly detail: string) {
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationService {
|
||||
private readonly _notifications = new Subject<Notification | null>();
|
||||
|
||||
public readonly notifications = this._notifications.asObservable();
|
||||
|
||||
public add(notification: Notification) {
|
||||
if (!notification.message || notification.message.trim() == ""){
|
||||
console.error("ERROR NOTIFICATION WITHOUT MESSAGE: " + notification)
|
||||
}
|
||||
this._notifications.next(notification);
|
||||
}
|
||||
|
||||
public flushNotification() {
|
||||
this._notifications.next(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import baseUrl from './api/helper';
|
||||
export interface UserInStorage{
|
||||
userId:string;
|
||||
email:string;
|
||||
displayName:string;
|
||||
username: string;
|
||||
roles: string,
|
||||
token:string;
|
||||
}
|
||||
export interface LoginInfoInStorage{
|
||||
success:boolean;
|
||||
message:string;
|
||||
landingPage:string;
|
||||
user?:UserInStorage;
|
||||
}
|
||||
@Injectable()
|
||||
export class UserInfoService {
|
||||
|
||||
public currentUserKey:string="currentUser";
|
||||
public storage:Storage = sessionStorage; // <--- you may switch between sessionStorage or LocalStrage (only one place to change)
|
||||
|
||||
|
||||
|
||||
constructor( private _http: HttpClient,
|
||||
) {}
|
||||
|
||||
//Store userinfo from session storage
|
||||
storeUserInfo(userInfoString:string) {
|
||||
this.storage.setItem(this.currentUserKey, userInfoString);
|
||||
}
|
||||
|
||||
//Remove userinfo from session storage
|
||||
removeUserInfo() {
|
||||
this.storage.removeItem(this.currentUserKey);
|
||||
}
|
||||
|
||||
//Get userinfo from session storage
|
||||
getUserInfo():UserInStorage|null {
|
||||
try{
|
||||
let userInfoString:string = this.storage.getItem(this.currentUserKey);
|
||||
if (userInfoString) {
|
||||
let userObj:UserInStorage = JSON.parse(this.storage.getItem(this.currentUserKey));
|
||||
return userObj;
|
||||
}
|
||||
else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
isLoggedIn():boolean {
|
||||
return this.storage.getItem(this.currentUserKey)?true:false;
|
||||
}
|
||||
|
||||
//Get User's Display name from session storage
|
||||
getUserName():string {
|
||||
let userObj:UserInStorage = this.getUserInfo();
|
||||
if (userObj!== null) {
|
||||
return userObj.displayName
|
||||
}
|
||||
return "no-user";
|
||||
}
|
||||
|
||||
getEmail():string {
|
||||
let userObj:UserInStorage = this.getUserInfo();
|
||||
if (userObj!== null) {
|
||||
return userObj.email
|
||||
}
|
||||
return "no-user";
|
||||
}
|
||||
|
||||
|
||||
getRoles(): string {
|
||||
let userObj:UserInStorage = this.getUserInfo();
|
||||
if (userObj!== null) {
|
||||
return userObj.roles
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// Get User Id from session storage
|
||||
getUserId(): string {
|
||||
let userObj:UserInStorage = this.getUserInfo();
|
||||
if (userObj!== null) {
|
||||
return userObj.userId;
|
||||
}
|
||||
return "no-user";
|
||||
}
|
||||
|
||||
getStoredToken():string|null {
|
||||
let userObj:UserInStorage = this.getUserInfo();
|
||||
if (userObj !== null) {
|
||||
return userObj.token;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public getAllUsers(){
|
||||
return this._http.get(`${baseUrl}/api/all-users`);
|
||||
}
|
||||
|
||||
public getUserById(id: any){
|
||||
return this._http.get(`${baseUrl}/api/get-one/${id}`);
|
||||
}
|
||||
|
||||
public updateUserById(id: any, user: any){
|
||||
return this._http.put(`${baseUrl}/api/org-users/${id}`, user);
|
||||
}
|
||||
|
||||
public deleteUserById(id: any){
|
||||
return this._http.delete(`${baseUrl}/api/org-users/${id}`);
|
||||
}
|
||||
public logout(){
|
||||
return this._http.get(`${baseUrl}/token/logout`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user