Compare commits
No commits in common. "aebc2136e9f6a92427379c15e2a1ab43c7abed45" and "2f42071b3a2edb195163ce003a167d4e3031a354" have entirely different histories.
aebc2136e9
...
2f42071b3a
@ -218,7 +218,7 @@ const useRealtimeData = (formId, sheetName, direction, formType, year) => {
|
||||
}
|
||||
setData((prevData) => {
|
||||
let data = structuredClone(prevData);
|
||||
if (prevData[0]?.row_type !== "ROOT" && updates[0][0] === 'ROOT') {
|
||||
if (prevData[0]?.row_type !== "ROOT") {
|
||||
const newRowRoot = updates[0];
|
||||
data = addRootRow(data, newRowRoot);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ import { getDataRowId, getParentId } from './rowUtils';
|
||||
|
||||
export function setNewValueToData(data, colId, rowId, value) {
|
||||
let targetObject = data;
|
||||
if (rowId?.length) {
|
||||
if (rowId && rowId.length) {
|
||||
const indices = rowId.split('.').map(Number);
|
||||
for (let i = 0; i < indices.length; i++) {
|
||||
const index = indices[i];
|
||||
@ -213,7 +213,7 @@ export function deleteRow(data, lineId) {
|
||||
const row = rows[i];
|
||||
const rowId = getDataRowId(row.data);
|
||||
|
||||
if (rowId === lineId) {
|
||||
if (rowId == lineId) {
|
||||
rowDeleteSortOrder = row.sort_order;
|
||||
rows.splice(i, 1);
|
||||
i--;
|
||||
|
||||
@ -134,6 +134,8 @@ export const AddStagesModal = ({
|
||||
}
|
||||
};
|
||||
|
||||
const isFormValid = startDate && endDate && stageName.trim() && selectedSheet && selectedDirection;
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
const stageStatus = stage ? getStageStatus(stage) : null;
|
||||
@ -145,8 +147,6 @@ export const AddStagesModal = ({
|
||||
const sheetObj = sheetOptions.find((s) => s.value === selectedSheet);
|
||||
const showDirectionSelect = sheetObj?.direction;
|
||||
|
||||
const isFormValid = startDate && endDate && stageName.trim() && selectedSheet && (selectedDirection || showDirectionSelect);
|
||||
|
||||
return (
|
||||
<ModalBackdrop isOpen={isOpen} onClick={handleBackdropClick}>
|
||||
<ModalContainer>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user