fix: reload startupservice after user approves the MPE_TABLES page

This commit is contained in:
Mihajlo Medjedovic
2025-06-06 15:03:36 +02:00
parent 881d2b060e
commit e5f8e500c1
4 changed files with 43 additions and 17 deletions

View File

@@ -1,30 +1,14 @@
import { BaseSASResponse } from './common/BaseSASResponse'
export interface EditorsStageDataSASResponse extends BaseSASResponse {
SYSDATE: string
SYSTIME: string
sasparams: Sasparam[]
_DEBUG: string
_PROGRAM: string
AUTOEXEC: string
MF_GETUSER: string
SYSCC: string
SYSENCODING: string
SYSERRORTEXT: string
SYSHOSTINFOLONG: string
SYSHOSTNAME: string
SYSPROCESSID: string
SYSPROCESSMODE: string
SYSPROCESSNAME: string
SYSJOBID: string
SYSSCPL: string
SYSSITE: string
SYSTCPIPHOSTNAME: string
SYSUSERID: string
SYSVLONG: string
SYSWARNINGTEXT: string
END_DTTM: string
MEMSIZE: string
}
export interface Sasparam {

View File

@@ -0,0 +1,28 @@
import { BaseSASResponse } from "./common/BaseSASResponse";
export interface PublicGetChangeinfo extends BaseSASResponse {
jsparams: Jsparam[]
}
export interface Jsparam {
TABLE_ID: string;
SUBMIT_STATUS_CD: string;
BASE_LIB: string;
BASE_DS: string;
SUBMITTED_BY_NM: string;
SUBMITTED_ON: number;
SUBMITTED_REASON_TXT: string;
INPUT_OBS: number;
INPUT_VARS: number;
NUM_OF_APPROVALS_REQUIRED: number;
NUM_OF_APPROVALS_REMAINING: number;
REVIEWED_BY_NM: string;
REVIEWED_ON?: any;
TABLE_NM: string;
BASE_TABLE: string;
REVIEWED_ON_DTTM: string;
SUBMITTED_ON_DTTM: string;
LIB_ENGINE: string;
ALLOW_RESTORE: string;
REASON: string;
}

View File

@@ -13,6 +13,8 @@ import {
AuditorsPostdataSASResponse,
Param
} from '../../models/sas/auditors-postdata.model'
import { PublicGetChangeinfo } from 'src/app/models/sas/public-getchangeinfo.model'
import { SasService } from 'src/app/services'
interface ChangesObj {
ind: any
@@ -76,9 +78,11 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
public diffsLimit: boolean = false
public recordsLimit: number = 100
public refreshStartupserviceAfterApprove: boolean = false
constructor(
private sasStoreService: SasStoreService,
private sasService: SasService,
private eventService: EventService,
private router: ActivatedRoute,
private route: Router
@@ -162,6 +166,8 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
await this.sasStoreService
.approveTable(approveParams, 'SASControlTable', 'auditors/postdata')
.then((res: any) => {
// If we are approving MPE_TABLES we will arm the trigger for the reload of startup data to se the updated tables
if (this.refreshStartupserviceAfterApprove) this.sasService.reloadStartupData()
this.route.navigateByUrl('/review/history')
})
.catch((err: any) => {
@@ -176,7 +182,7 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
public async callChangesInfo(tableId: any) {
await this.sasStoreService
.getChangeInfo(tableId)
.then((res: any) => {
.then((res: PublicGetChangeinfo) => {
this.tableDetails = res.jsparams[0]
this.jsParams = res.jsparams[0]
@@ -189,6 +195,10 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
}
this.keysArray = keysArray
// If we are approving MPE_TABLES we will arm the trigger for the reload of startup data to se the updated tables
// After user approved if armed, reload will be triggered
if (res.jsparams[0].BASE_DS === 'MPE_TABLES') this.refreshStartupserviceAfterApprove = true
})
.catch((err: any) => {
this.acceptLoading = false

View File

@@ -333,6 +333,10 @@ export class SasService {
})
}
public reloadStartupData() {
this.loadStartupServiceEmitter.emit()
}
public getLicenseSiteId(): string[] {
return this.license_site_id.value || []
}