Skip to content
Snippets Groups Projects
Commit 1f97c25e authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

Merge branch 'TMSS-3014-Front-End-Only-Fix-Project-Status-P2' into 'master'

Fix Project status  change dialog

See merge request !1394
parents 411bf0e9 ba49cb19
No related branches found
No related tags found
1 merge request!1394Fix Project status change dialog
...@@ -230,9 +230,7 @@ export function ProjectList(props) { ...@@ -230,9 +230,7 @@ export function ProjectList(props) {
*/ */
const getSUDialogContent = () => { const getSUDialogContent = () => {
let changedData = []; let changedData = [];
console.log( "getSUDialogContent",selectedRows)
for (const row of selectedRows) { for (const row of selectedRows) {
console.log("Row is",row)
let changedRow = {} let changedRow = {}
changedRow.project_state_value = changedStatus; changedRow.project_state_value = changedStatus;
...@@ -257,7 +255,6 @@ export function ProjectList(props) { ...@@ -257,7 +255,6 @@ export function ProjectList(props) {
* @returns Content to be displayed in dialog after updating the staus in backend * @returns Content to be displayed in dialog after updating the staus in backend
*/ */
const getSUResponseDialogContent = () => { const getSUResponseDialogContent = () => {
console.log ("getSUResponseDialogContent",statusChangeResponse)
return ( return (
<div style={{ marginTop: '1em' }}> <div style={{ marginTop: '1em' }}>
<b></b> <b></b>
...@@ -295,7 +292,6 @@ export function ProjectList(props) { ...@@ -295,7 +292,6 @@ export function ProjectList(props) {
* Show confirmation dialog to update status change * Show confirmation dialog to update status change
*/ */
const confirmStatusChange = () => { const confirmStatusChange = () => {
console.log("confirmStatusChange")
let newdialog = {}; let newdialog = {};
newdialog.type = "confirmation"; newdialog.type = "confirmation";
newdialog.header = `Confirm Project(s) Status Change`; newdialog.header = `Confirm Project(s) Status Change`;
...@@ -307,7 +303,6 @@ export function ProjectList(props) { ...@@ -307,7 +303,6 @@ export function ProjectList(props) {
}, },
{ {
id: 'no', title: 'No', callback: () => { id: 'no', title: 'No', callback: () => {
console.log("Calling Close from confirmStatusChange")
setChangedStatus(null) setChangedStatus(null)
closeDialog() closeDialog()
} }
...@@ -331,11 +326,10 @@ export function ProjectList(props) { ...@@ -331,11 +326,10 @@ export function ProjectList(props) {
* Updating status in backend on confirmation and displaying response of the updation * Updating status in backend on confirmation and displaying response of the updation
*/ */
const submitStatusChange = async () => { const submitStatusChange = async () => {
console.log("submitStatusChange",selectedRows)
let newStatusChangeResponse = [] let newStatusChangeResponse = []
for (const row of selectedRows) { for (const row of selectedRows) {
row.project_state = changedStatus.url row.project_state = row.project_state.replace(row.project_state_value, changedStatus) // this is the write field
row.project_state_value = changedStatus; row.project_state_value = changedStatus; // for consistency, will be ignored at the server
let response = await ProjectService.updateProject(row.name, row) let response = await ProjectService.updateProject(row.name, row)
if (response.isUpdated) { if (response.isUpdated) {
newStatusChangeResponse.push({ newStatusChangeResponse.push({
...@@ -353,7 +347,6 @@ export function ProjectList(props) { ...@@ -353,7 +347,6 @@ export function ProjectList(props) {
appGrowl.show({ severity: 'error', summary: 'Failed to update project status' }); appGrowl.show({ severity: 'error', summary: 'Failed to update project status' });
} }
} }
console.log("newStatusChangeResponse", newStatusChangeResponse)
setStatusChangeResponse(newStatusChangeResponse) setStatusChangeResponse(newStatusChangeResponse)
...@@ -362,7 +355,6 @@ export function ProjectList(props) { ...@@ -362,7 +355,6 @@ export function ProjectList(props) {
useEffect(()=>{ useEffect(()=>{
if (statusChangeResponse==null) return if (statusChangeResponse==null) return
let newdialog = {...dialog} let newdialog = {...dialog}
console.log(newdialog)
newdialog.type = "confirmation"; newdialog.type = "confirmation";
newdialog.header = `Project(s) Status Update Info`; newdialog.header = `Project(s) Status Update Info`;
newdialog.content = getSUResponseDialogContent; newdialog.content = getSUResponseDialogContent;
......
...@@ -19,7 +19,6 @@ export default function ProjectStatusDialog(props) { ...@@ -19,7 +19,6 @@ export default function ProjectStatusDialog(props) {
const Save = () => { const Save = () => {
if (!onSave) return; if (!onSave) return;
onSave(projectStatus); onSave(projectStatus);
} }
const footer = ( const footer = (
......
...@@ -5,7 +5,6 @@ import { appGrowl } from "../../../../layout/components/AppGrowl"; ...@@ -5,7 +5,6 @@ import { appGrowl } from "../../../../layout/components/AppGrowl";
import ScheduleService from "../../../../services/schedule.service"; import ScheduleService from "../../../../services/schedule.service";
import { getStatusContent } from "../contents"; import { getStatusContent } from "../contents";
import { Button } from "primereact/button"; import { Button } from "primereact/button";
import { useState } from "react";
import _ from 'lodash'; import _ from 'lodash';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment