diff --git a/frontend/Site/src/app/components/action/ActionsConfig.ts b/frontend/Site/src/app/components/action/ActionsConfig.ts index c90956d8..8e4c0e77 100644 --- a/frontend/Site/src/app/components/action/ActionsConfig.ts +++ b/frontend/Site/src/app/components/action/ActionsConfig.ts @@ -1,17 +1,18 @@ +import { SiteDetailsMode } from "../../features/details/dto/SiteDetailsMode"; import { UserMode } from "../../helpers/requests/userMode"; import { DropdownItem } from "./IActions"; export const ActionItems: DropdownItem[] = [ { label:'Edit Mode', - value: UserMode.EditMode + value: SiteDetailsMode.EditMode }, { label:'SR Mode', - value: UserMode.SrMode + value: SiteDetailsMode.SRMode }, { label:'Delete', - value: UserMode.DeleteMode + value: SiteDetailsMode.ViewOnlyMode }, ] \ No newline at end of file diff --git a/frontend/Site/src/app/components/action/IActions.ts b/frontend/Site/src/app/components/action/IActions.ts index 30cc2fe3..697f5d7d 100644 --- a/frontend/Site/src/app/components/action/IActions.ts +++ b/frontend/Site/src/app/components/action/IActions.ts @@ -1,8 +1,9 @@ -import { UserMode } from "../../helpers/requests/userMode"; +import { SiteDetailsMode } from "../../features/details/dto/SiteDetailsMode"; + export interface DropdownItem { label: string; - value: UserMode; + value: SiteDetailsMode; } export interface IActions { diff --git a/frontend/Site/src/app/components/input-controls/InputControls.tsx b/frontend/Site/src/app/components/input-controls/InputControls.tsx index 45a61ce8..b216e6a8 100644 --- a/frontend/Site/src/app/components/input-controls/InputControls.tsx +++ b/frontend/Site/src/app/components/input-controls/InputControls.tsx @@ -1,345 +1,598 @@ import { useState } from "react"; import { FormFieldType, IFormField } from "./IFormField"; -import avatar from '../../images/avatar.png'; +import avatar from "../../images/avatar.png"; import { formatDateRange } from "../../helpers/utility"; -import { DateRangePicker } from 'rsuite'; -import { CalendarIcon } from '../common/icon'; +import { DateRangePicker } from "rsuite"; +import { CalendarIcon } from "../common/icon"; import { Link as RouterLink } from "react-router-dom"; interface InputProps extends IFormField { - children?: InputProps[]; - isEditing?: boolean; - srMode?: boolean; - onChange: (value: any) => void; + children?: InputProps[]; + isEditing?: boolean; + srMode?: boolean; + onChange: (value: any) => void; } -export const Link:React.FC = ({label, placeholder, type, value, validation, allowNumbersOnly, isEditing, customLabelCss, customInputTextCss, customEditLabelCss, customEditInputTextCss, onChange, tableMode, href})=> { - return ( +export const Link: React.FC = ({ + label, + placeholder, + type, + value, + validation, + allowNumbersOnly, + isEditing, + customLabelCss, + customInputTextCss, + customEditLabelCss, + customEditInputTextCss, + onChange, + tableMode, + href, +}) => { + return ( - - {value} - - ) -} - - -export const Label:React.FC = ({label, placeholder, type, value, validation, allowNumbersOnly, isEditing, customLabelCss, customInputTextCss, customEditLabelCss, customEditInputTextCss, onChange, tableMode})=> { - return ( -

{value}

- ) -} - -export const TextInput: React.FC = ({label, placeholder, type, value, validation, allowNumbersOnly, isEditing, srMode, customLabelCss, customInputTextCss, customEditLabelCss, customEditInputTextCss, onChange, tableMode})=> { + + View + + + ); +}; - const [error, setError] = useState(null); +export const Label: React.FC = ({ + label, + placeholder, + type, + value, + validation, + allowNumbersOnly, + isEditing, + customLabelCss, + customInputTextCss, + customEditLabelCss, + customEditInputTextCss, + onChange, + tableMode, +}) => { + return ( + +

{value}

+ + ); +}; - const validateInput = (inputValue: string) => { - if(validation) - { - if(validation.pattern && !validation.pattern.test(inputValue)) - { - setError(validation.customMessage || 'Invalid input'); - return false; - } - } +export const TextInput: React.FC = ({ + label, + placeholder, + type, + value, + validation, + allowNumbersOnly, + isEditing, + srMode, + customLabelCss, + customInputTextCss, + customEditLabelCss, + customEditInputTextCss, + onChange, + tableMode, +}) => { + const [error, setError] = useState(null); - setError(null); - return true; + const validateInput = (inputValue: string) => { + if (validation) { + if (validation.pattern && !validation.pattern.test(inputValue)) { + setError(validation.customMessage || "Invalid input"); + return false; + } } - const handleTextInputChange = (e : React.ChangeEvent) => { - const inputValue = e.target.value; - if(allowNumbersOnly) - { - if(validateInput(inputValue)) - { - onChange(inputValue); // Update parent component state only if validation passes - } - } - else - { - onChange(inputValue); - } + setError(null); + return true; + }; + + const handleTextInputChange = (e: React.ChangeEvent) => { + const inputValue = e.target.value; + if (allowNumbersOnly) { + if (validateInput(inputValue)) { + onChange(inputValue); // Update parent component state only if validation passes + } + } else { + onChange(inputValue); } + }; - const handleCheckBoxChange = (isChecked: boolean) => { - onChange(isChecked); - }; + const handleCheckBoxChange = (isChecked: boolean) => { + onChange(isChecked); + }; - // Replace any spaces in the label with underscores to create a valid id - const inputTxtId = label.replace(/\s+/g, '_'); + // Replace any spaces in the label with underscores to create a valid id + const inputTxtId = label.replace(/\s+/g, "_"); - console.log("tableMode",tableMode) - if(tableMode) - { - return ( - - { isEditing ? - - : -

{value}

- } - {error &&
{error}
} - - ); - } - else - { - return ( -
- { - !tableMode && - <> - { - srMode && - - } - - - } - { - isEditing ? - - : -

{value}

- } - {error &&
{error}
} -
- ); - } - - -} + console.log("tableMode", tableMode); + if (tableMode) { + return ( + + {isEditing ? ( + + ) : ( +

{value}

+ )} + {error &&
{error}
} + + ); + } else { + return ( +
+ {!tableMode && ( + <> + {srMode && ( + + )} + + + )} + {isEditing ? ( + + ) : ( +

{value}

+ )} + {error &&
{error}
} +
+ ); + } +}; + +export const Dropdown: React.FC = ({ + label, + placeholder, + options, + value, + isEditing, + srMode, + isImage, + customLabelCss, + customInputTextCss, + customEditLabelCss, + customEditInputTextCss, + onChange, + tableMode, +}) => { + // Replace any spaces in the label with underscores to create a valid id + const drdownId = label.replace(/\s+/g, "_"); + const [selected, setSelected] = useState(false); + const imgUrl = avatar; -export const Dropdown: React.FC = ({ label, placeholder, options, value, isEditing, srMode, isImage, customLabelCss, customInputTextCss, customEditLabelCss, customEditInputTextCss, onChange }) => { + const handleSelectChange = (event: React.ChangeEvent) => { + const selectedOption = event.target.value.trim(); + setSelected(selectedOption !== ""); + onChange(selectedOption); + }; - // Replace any spaces in the label with underscores to create a valid id - const drdownId = label.replace(/\s+/g, '_'); - const [selected, setSelected] = useState(false); - const imgUrl = avatar; + const handleCheckBoxChange = (isChecked: boolean) => { + onChange(isChecked); + }; - const handleSelectChange = (event: React.ChangeEvent) => { - const selectedOption = event.target.value.trim(); - setSelected(selectedOption !== ''); - onChange(selectedOption); - }; + const isFirstOptionGrey = value === ""; + if (tableMode) { + return ( + + + {/* Create a select element with the form-select class */} + {isEditing ? ( + + ) : ( +

+ {options?.find((opt) => opt.key === value)?.value} +

+ )} + + ); - const handleCheckBoxChange = (isChecked: boolean) => { - onChange(isChecked); - }; + } else { + return ( +
+ {srMode && ( + + )} + {/* Create a label for the dropdown using the form-label class */} - const isFirstOptionGrey = value === ''; - return( -
- { - srMode && - - } - {/* Create a label for the dropdown using the form-label class */} - + - {/* Create a select element with the form-select class */} - { isEditing ? - - : - isImage ? -
- opt.key === value)?.imageUrl ?? imgUrl} alt="User image." className="custom-form-image" aria-hidden="true" role="img" aria-label="User image"/> -

{options?.find(opt => opt.key === value)?.value}

-
- : -

{options?.find(opt => opt.key === value)?.value}

- } -
+ {/* Create a select element with the form-select class */} + {isEditing ? ( + + ) : isImage ? ( +
+ opt.key === value)?.imageUrl ?? imgUrl + } + alt="User image." + className="custom-form-image" + aria-hidden="true" + role="img" + aria-label="User image" + /> +

+ {options?.find((opt) => opt.key === value)?.value} +

+
+ ) : ( +

+ {options?.find((opt) => opt.key === value)?.value} +

+ )} +
); -} + } +}; -export const GroupInput: React.FC = ({label, children, isEditing, srMode, customLabelCss, customInputTextCss, customEditLabelCss, customEditInputTextCss, onChange}) =>{ - const [error, setError] = useState(null); - let currentConcatenatedValue; +export const GroupInput: React.FC = ({ + label, + children, + isEditing, + srMode, + customLabelCss, + customInputTextCss, + customEditLabelCss, + customEditInputTextCss, + onChange, +}) => { + const [error, setError] = useState(null); + let currentConcatenatedValue; - if(!isEditing) - { - currentConcatenatedValue = children?.reduce((accumulator, currentValue, index) => { - if(currentValue.value) - { - accumulator = accumulator + currentValue.value + currentValue.suffix; - } - return accumulator; - }, ''); - } - const validateInput = (inputValue: string, validation?: RegExp, customMessage?: string) => { - if(validation) - { - if(validation && !validation.test(inputValue)) - { - setError(customMessage || 'Invalid input'); - return false; - } + if (!isEditing) { + currentConcatenatedValue = children?.reduce( + (accumulator, currentValue, index) => { + if (currentValue.value) { + accumulator = accumulator + currentValue.value + currentValue.suffix; } - - setError(null); - return true; + return accumulator; + }, + "" + ); + } + const validateInput = ( + inputValue: string, + validation?: RegExp, + customMessage?: string + ) => { + if (validation) { + if (validation && !validation.test(inputValue)) { + setError(customMessage || "Invalid input"); + return false; + } } - const handleTextInputChange = ( - e: React.ChangeEvent, - child: InputProps - ) => { - const inputValue = e.target.value.trim(); - if (child.allowNumbersOnly) { - if ( - validateInput( - inputValue, - child.validation?.pattern, - child.validation?.customMessage - ) - ) { - child.onChange(inputValue); // Update parent component state only if validation passes - } - } else { - child.onChange(inputValue); - } - }; + setError(null); + return true; + }; + + const handleTextInputChange = ( + e: React.ChangeEvent, + child: InputProps + ) => { + const inputValue = e.target.value.trim(); + if (child.allowNumbersOnly) { + if ( + validateInput( + inputValue, + child.validation?.pattern, + child.validation?.customMessage + ) + ) { + child.onChange(inputValue); // Update parent component state only if validation passes + } + } else { + child.onChange(inputValue); + } + }; - const handleCheckBoxChange = (isChecked: boolean) => { - onChange(isChecked); - }; + const handleCheckBoxChange = (isChecked: boolean) => { + onChange(isChecked); + }; - return( -
{/* Container for the group input */} - { - srMode && - - } - {/* Label for the group input */} - - - {/* Bootstrap row for the group of child fields */} -
- { isEditing ? - children?.map((child, index) => ( -
- {/* Render each child field as an input element */} - handleTextInputChange(e, child)} - aria-label={child.label} // Accessibility - /> - -
- )) - : - {currentConcatenatedValue != undefined ? currentConcatenatedValue : ''} - } - {error &&
{error}
} + return ( +
+ {" "} + {/* Container for the group input */} + {srMode && ( + + )} + {/* Label for the group input */} + + {/* Bootstrap row for the group of child fields */} +
+ {isEditing ? ( + children?.map((child, index) => ( +
+ {/* Render each child field as an input element */} + handleTextInputChange(e, child)} + aria-label={child.label} // Accessibility + />
-
- ); -} + )) + ) : ( + + {currentConcatenatedValue != undefined + ? currentConcatenatedValue + : ""} + + )} + {error &&
{error}
} +
+
+ ); +}; -export const DateInput: React.FC = ({ label, placeholder, value, isEditing, srMode, customLabelCss, customInputTextCss, customEditLabelCss, customEditInputTextCss, onChange }) => { - let dateRangeValue; - if(value.length > 0) - { - dateRangeValue = formatDateRange(value); - } +export const DateInput: React.FC = ({ + label, + placeholder, + value, + isEditing, + srMode, + customLabelCss, + customInputTextCss, + customEditLabelCss, + customEditInputTextCss, + onChange, +}) => { + let dateRangeValue; + if (value.length > 0) { + dateRangeValue = formatDateRange(value); + } - const handleCheckBoxChange = (isChecked: boolean) => { - onChange(isChecked); - }; - // Replace any spaces in the label with underscores to create a valid id - const dateRangeId = label.replace(/\s+/g, '_'); - return ( + const handleCheckBoxChange = (isChecked: boolean) => { + onChange(isChecked); + }; + // Replace any spaces in the label with underscores to create a valid id + const dateRangeId = label.replace(/\s+/g, "_"); + return (
- { - srMode && - - } - - { isEditing ? - onChange(value)} - /> - : -

{dateRangeValue ?? ''}

- } - + {srMode && ( + + )} + + {isEditing ? ( + onChange(value)} + /> + ) : ( +

{dateRangeValue ?? ""}

+ )}
-)}; + ); +}; + +export const CheckBoxInput: React.FC = ({ + label, + isLabel, + isChecked, + customLabelCss, + customEditLabelCss, + customEditInputTextCss, + isEditing, + type, + value, + onChange, + tableMode +}) => { + const inputTxtId = label.replace(/\s+/g, "_"); + const handleCheckboxChange = (e: React.ChangeEvent) => { + onChange(e.target.checked); // Toggle the checked state and pass it to the parent component + }; -export const CheckBoxInput: React.FC = ({ label, isLabel, isChecked, customLabelCss, customEditLabelCss, customEditInputTextCss, isEditing, type, value, onChange }) => { - const inputTxtId = label.replace(/\s+/g, '_'); - const handleCheckboxChange = (e: React.ChangeEvent) => { - onChange(e.target.checked); // Toggle the checked state and pass it to the parent component - }; - - return ( -
+ if(tableMode) + { + return ( + +
+ + {isLabel && ( + + )} +
+ + ); + } + else + { + return ( +
- - { - isLabel && -
-
- ); -} \ No newline at end of file +
+ ); + } +}; diff --git a/frontend/Site/src/app/components/table/body/TableBody.tsx b/frontend/Site/src/app/components/table/body/TableBody.tsx index fa308bf9..6e2eb70b 100644 --- a/frontend/Site/src/app/components/table/body/TableBody.tsx +++ b/frontend/Site/src/app/components/table/body/TableBody.tsx @@ -4,7 +4,7 @@ import { RequestStatus } from "../../../helpers/requests/status"; import { TableColumn } from "../TableColumn"; import { FormFieldType, IFormField } from "../../input-controls/IFormField"; -import { Label, TextInput , Link } from "../../input-controls/InputControls"; +import { Label, TextInput , Link ,Dropdown,CheckBoxInput } from "../../input-controls/InputControls"; import { ChangeTracker } from "../../common/IChangeType"; interface TableBodyProps { @@ -123,6 +123,50 @@ const TableBody: FC = ({ /> ); } + else if(field.type === FormFieldType.DropDown) + { + return ( + tableRecordChangeHandler(rowKey,field.graphQLPropertyName, value)} + type={field.type} + validation={field.validation} + allowNumbersOnly={field.allowNumbersOnly} + isEditing={editMode ?? true} + tableMode={field.tableMode ?? false} + href={field.href} + options={field.options} + /> + ); + } + else if(field.type === FormFieldType.Checkbox) + { + return ( + tableRecordChangeHandler(rowKey,field.graphQLPropertyName, value)} + type={field.type} + validation={field.validation} + allowNumbersOnly={field.allowNumbersOnly} + isEditing={editMode ?? true} + tableMode={field.tableMode ?? false} + href={field.href} + options={field.options} + /> + ); + } }; const getValue = (rowIndex: number, propertyName: string) => { @@ -155,7 +199,7 @@ const TableBody: FC = ({ column.displayType, column.displayName, cellValue ?? "", - columnIndex + rowIndex, + rowIndex, column.linkRedirectionURL ?? "", changeHandler, editMode diff --git a/frontend/Site/src/app/components/widget/IWidget.ts b/frontend/Site/src/app/components/widget/IWidget.ts index ae19f44a..dafcb50d 100644 --- a/frontend/Site/src/app/components/widget/IWidget.ts +++ b/frontend/Site/src/app/components/widget/IWidget.ts @@ -11,4 +11,5 @@ export interface IWidget { hideTable?:boolean; hideTitle?:boolean; editMode?:boolean; + changeHandler:(event:any)=>void; } \ No newline at end of file diff --git a/frontend/Site/src/app/components/widget/Widget.tsx b/frontend/Site/src/app/components/widget/Widget.tsx index ef77a854..92d0bfd5 100644 --- a/frontend/Site/src/app/components/widget/Widget.tsx +++ b/frontend/Site/src/app/components/widget/Widget.tsx @@ -14,6 +14,7 @@ const Widget: React.FC = ({ hideTable, hideTitle, editMode, + changeHandler }) => { return(
@@ -32,7 +33,7 @@ const Widget: React.FC = ({ data={tableData} showPageOptions={false} allowRowsSelect={allowRowsSelect} - changeHandler={()=>{}} + changeHandler={changeHandler} editMode={editMode ?? false} />
diff --git a/frontend/Site/src/app/features/dashboard/Dashboard.tsx b/frontend/Site/src/app/features/dashboard/Dashboard.tsx index 49e23888..fedd020a 100644 --- a/frontend/Site/src/app/features/dashboard/Dashboard.tsx +++ b/frontend/Site/src/app/features/dashboard/Dashboard.tsx @@ -24,6 +24,11 @@ interface DashboardWidgetProps { onButtonClick?: () => void; } +const changeHandler = (event:any) => { + console.log(event); +} + + const DashboardTableWidget: React.FC = ({ title, buttonText, @@ -33,7 +38,7 @@ const DashboardTableWidget: React.FC = ({ allowRowsSelect, onButtonClick, }) => ( - + { buttonText && onButtonClick &&
+ + {/* For Action Dropdown*/} {(!edit && viewMode === SiteDetailsMode.ViewOnlyMode && userType === UserType.Internal) && } + + + {/* For Edit / SR Dropdown*/}
{edit && userType === UserType.Internal && <> @@ -166,6 +178,8 @@ const SiteDetails = () => { }
+ + {/* For Cart /Folio Controls*/} { (!edit && viewMode === SiteDetailsMode.ViewOnlyMode && userType === UserType.External) && <>
+
+
+ + +
+
+ +
+
); diff --git a/frontend/Site/src/app/features/details/SummaryForm.tsx b/frontend/Site/src/app/features/details/SummaryForm.tsx index 59902b68..fe8330c8 100644 --- a/frontend/Site/src/app/features/details/SummaryForm.tsx +++ b/frontend/Site/src/app/features/details/SummaryForm.tsx @@ -7,10 +7,11 @@ import "./SummaryForm.css" interface SummaryFormProps{ sitesDetails: Sites, edit: boolean, + srMode: boolean, changeHandler:(graphQLPropertyName: any, value: String | [Date, Date])=>void } -const SummaryForm:FC = ({sitesDetails, edit, changeHandler}) => { +const SummaryForm:FC = ({sitesDetails, edit,srMode, changeHandler}) => { const formRows: IFormField[][] = [ [ { @@ -200,7 +201,7 @@ const SummaryForm:FC = ({sitesDetails, edit, changeHandler}) = return (
{}}> - = ({ }; const handleAddParticipant = () => { - alert('handleAddParticipant click'); + + setData([...data , { + id:0, + role: "", + participantName: "", + sr: true, + date: new Date() + }]) + + //alert('handleAddParticipant click'); + }; const handleRemoveParticipant = () => { alert('handleRemoveParticipant click'); }; + const resetDetails = useSelector(resetSiteDetails); + useEffect(()=>{ + + if(resetDetails) + { + setFormData({}) + setData(dummyData); + } + + },[resetDetails]); + const handleInputChange = (graphQLPropertyName: any, value: String | [Date, Date]) => { if(viewMode === SiteDetailsMode.SRMode) { @@ -160,6 +175,21 @@ const Notations: React.FC = ({ // setViewMode(SiteDetailsMode.SRMode); }; + const changeHandler = (event:any) => { + + let existingRecords = [...data]; + + let index = existingRecords.findIndex(obj => obj.id === event.row.id); + + + existingRecords[index][event.property] = event.value; + + setData([...existingRecords]); + + //event + console.log(event); + } + return ( <>
@@ -196,8 +226,8 @@ const Notations: React.FC = ({
- + { viewMode === SiteDetailsMode.EditMode && userType === UserType.Internal &&
diff --git a/frontend/Site/src/app/features/site/Search.css b/frontend/Site/src/app/features/site/Search.css index 8bfaf476..dfd3f5cf 100644 --- a/frontend/Site/src/app/features/site/Search.css +++ b/frontend/Site/src/app/features/site/Search.css @@ -292,4 +292,14 @@ div.search-parent display: flex; flex-direction: column; gap: var(--layout-margin-xlarge); +} + +.link-for-table +{ + font-size: 12px; + font-weight: 700; + line-height: 16px; + text-align: left; + color: var(--surface-primary-default); + text-decoration: none; } \ No newline at end of file diff --git a/frontend/Site/src/app/features/site/dto/Columns.ts b/frontend/Site/src/app/features/site/dto/Columns.ts index af61ffa8..533c85e0 100644 --- a/frontend/Site/src/app/features/site/dto/Columns.ts +++ b/frontend/Site/src/app/features/site/dto/Columns.ts @@ -212,7 +212,7 @@ const getSiteSearchResultsColumns = () => { true, 1, true, - getColumnType("View","id","") , + getLinkColumnType("Map","id","","site/map/") , "site/map/", true ), @@ -228,6 +228,7 @@ const getSiteSearchResultsColumns = () => { true, getLinkColumnType("Details","id","","site/details/"), "site/details/", + true, ), ]; @@ -256,8 +257,8 @@ const getLinkColumnType = (label:string, propertyName:string, value:string, href label: label, graphQLPropertyName: propertyName, value:value, - customLabelCss: "custom-lbl-text", - customInputTextCss: "custom-input-text", + customLabelCss: "link-for-table", + customInputTextCss: "link-for-table", tableMode: true, href: href } diff --git a/frontend/Site/src/app/features/site/dto/SiteSlice.ts b/frontend/Site/src/app/features/site/dto/SiteSlice.ts index 13372422..f8771263 100644 --- a/frontend/Site/src/app/features/site/dto/SiteSlice.ts +++ b/frontend/Site/src/app/features/site/dto/SiteSlice.ts @@ -28,6 +28,7 @@ const initialState: SiteState = { siteDetailsUpdateStatus: RequestStatus.idle, changeTracker: [], siteDetailsMode: SiteDetailsMode.ViewOnlyMode, + resetSiteDetails: false, }; export const fetchSitesDetails = createAsyncThunk( @@ -165,20 +166,31 @@ const siteSlice = createSlice({ }, trackChanges: (state, action) => { console.log("tracking change", state, action); - const newState = { - ...state, - changeTracker: [...state.changeTracker, action.payload], - }; - console.log("tracking change 2 ", newState); + let recordExists = state.changeTracker.filter((tracked)=>{ + return tracked.changeType === action.payload.changeType && tracked.label === action.payload.label + }) - return newState; + if (recordExists.length === 0) { + const newState = { + ...state, + changeTracker: [...state.changeTracker, action.payload], + resetSiteDetails: false, + }; + return newState; + } else { + const newState = { + ...state, + }; + return newState; + } }, clearTrackChanges: (state, action) => { console.log("tracking change", state, action); const newState = { ...state, changeTracker: [], + resetSiteDetails: true, }; console.log("tracking change 2 ", newState); @@ -240,6 +252,7 @@ export const siteDetailsLoadingState = (state: any) => export const selectSiteDetails = (state: any) => state.sites.siteDetails; export const trackedChanges = (state: any) => state.sites.changeTracker; export const siteDetailsMode = (state: any) => state.sites.siteDetailsMode; +export const resetSiteDetails = (state: any) => state.sites.resetSiteDetails; export const { siteAdded, @@ -249,7 +262,7 @@ export const { updateSearchQuery, trackChanges, clearTrackChanges, - updateSiteDetailsMode + updateSiteDetailsMode, } = siteSlice.actions; export default siteSlice.reducer; diff --git a/frontend/Site/src/app/features/site/dto/SiteState.ts b/frontend/Site/src/app/features/site/dto/SiteState.ts index aa318487..526ee5c5 100644 --- a/frontend/Site/src/app/features/site/dto/SiteState.ts +++ b/frontend/Site/src/app/features/site/dto/SiteState.ts @@ -22,4 +22,5 @@ export class SiteState siteDetailsUpdateStatus:string = RequestStatus.idle; changeTracker: ChangeTracker[] = []; siteDetailsMode: SiteDetailsMode = SiteDetailsMode.ViewOnlyMode; + resetSiteDetails : boolean = false; } \ No newline at end of file