Skip to content

Commit

Permalink
Fixed: additional parameter updating issue and id showing instead of …
Browse files Browse the repository at this point in the history
…job description once updating job (hotwax#734)
  • Loading branch information
amansinghbais committed Jan 13, 2025
1 parent ec37509 commit 4ea520e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
14 changes: 11 additions & 3 deletions src/components/MaargJobConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,17 @@ export default defineComponent({
const paramValues = generateJobCustomParameters(this.customRequiredParameters, this.customOptionalParameters, {});
job.serviceJobParameters.map((parameter: any) => {
if(paramValues[parameter.parameterName]) {
parameter.parameterValue = paramValues[parameter.parameterName]
Object.keys(paramValues).map((paramName: any) => {
const existingParameter = job.serviceJobParameters.find((parameter: any) => parameter.parameterName === paramName);
if(existingParameter) {
existingParameter.parameterValue = paramValues[paramName]
} else {
job.serviceJobParameters.push({
parameterName: paramName,
parameterValue: paramValues[paramName],
jobName: job.jobName
})
}
})
Expand Down
12 changes: 7 additions & 5 deletions src/store/modules/maargJob/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const actions: ActionTree<JobState, RootState> = {
let resp = {} as any;
let jobs = JSON.parse(JSON.stringify(state.maargJobs));
let currentJob = jobs[jobEnumId]
const maargJobEnums = store.getters["maargJob/getMaargJobEnums"]

try {
if(!currentJob?.jobName) {
Expand All @@ -74,17 +75,18 @@ const actions: ActionTree<JobState, RootState> = {

resp = await MaargJobService.fetchMaargJobInfo(currentJob.jobName);
if(!hasError(resp)) {
const currentJob = resp.data?.jobDetail
const updatedJob = resp.data?.jobDetail

const paramValue = {} as any;
currentJob.serviceJobParameters.map((parameter: any) => {
updatedJob.serviceJobParameters.map((parameter: any) => {
paramValue[parameter.parameterName] = parameter.parameterValue
})
currentJob["parameterValues"] = paramValue
updatedJob["parameterValues"] = paramValue
updatedJob["enumDescription"] = maargJobEnums[updatedJob.jobTypeEnumId]?.description

jobs[jobEnumId] = currentJob
jobs[jobEnumId] = updatedJob
commit(types.MAARGJOB_UPDATED, jobs);
commit(types.MAARGJOB_CURRENT_UPDATED, currentJob);
commit(types.MAARGJOB_CURRENT_UPDATED, updatedJob);
} else {
throw resp;
}
Expand Down

0 comments on commit 4ea520e

Please sign in to comment.