From a7f478df6ed53eca5917953dff2bc6a877a5fe62 Mon Sep 17 00:00:00 2001 From: collins-self Date: Wed, 13 Nov 2024 13:17:30 -0500 Subject: [PATCH 1/3] Adds link to content in MeterAsset --- .../Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx index 2b0b6cc18..91a956cb3 100644 --- a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx +++ b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx @@ -42,6 +42,7 @@ import { SelectRoles } from '../Store/UserSettings'; import GenerationAttributes from '../AssetAttribute/Generation'; import StationAuxAttributes from '../AssetAttribute/StationAux'; import StationBatteryAttributes from '../AssetAttribute/StationBattery'; +import { SystemCenterSettingSlice } from '../Store/Store'; declare var homePath: string; @@ -51,6 +52,9 @@ const MeterAssetWindow = (props: IProps) => { const MeterAssetController = new GenericController(`${homePath}api/OpenXDA/DetailedMeterAsset/${props.Meter.ID}`, "AssetName", true); const PagingID = 'MeterAssetPage' + const settings = useAppSelector(SystemCenterSettingSlice.Data); + const settingStatus = useAppSelector(SystemCenterSettingSlice.Status); + const [assetTypes, setAssetTypes] = React.useState([]); const [newEdit, setNewEdit] = React.useState('New'); @@ -75,6 +79,11 @@ const MeterAssetWindow = (props: IProps) => { const [pageInfo, setPageInfo] = React.useState<{ RecordsPerPage: number, NumberOfPages: number, TotalRecords: number }>({ RecordsPerPage: 0, NumberOfPages: 0, TotalRecords: 0 }); const [pageState, setPageState] = React.useState<'error' | 'idle' | 'loading'>('idle'); + React.useEffect(() => { + if (settingStatus == 'unintiated' || settingStatus == 'changed') + dispatch(SystemCenterSettingSlice.Fetch()); + }, [settingStatus]); + React.useEffect(() => { let h = getAssetTypes() h.done((data: Array) => { @@ -163,6 +172,10 @@ const MeterAssetWindow = (props: IProps) => { Field={'AssetKey'} HeaderStyle={{ width: 'auto' }} RowStyle={{ width: 'auto' }} + Content={({ item, field }) => + + {item[field]} + } > Key From e7640d0feddffeab6429dd326044f17e305317dc Mon Sep 17 00:00:00 2001 From: collins-self Date: Wed, 13 Nov 2024 13:23:39 -0500 Subject: [PATCH 2/3] had left in some uneeded changes --- .../Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx index 91a956cb3..9dee13d98 100644 --- a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx +++ b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx @@ -42,7 +42,6 @@ import { SelectRoles } from '../Store/UserSettings'; import GenerationAttributes from '../AssetAttribute/Generation'; import StationAuxAttributes from '../AssetAttribute/StationAux'; import StationBatteryAttributes from '../AssetAttribute/StationBattery'; -import { SystemCenterSettingSlice } from '../Store/Store'; declare var homePath: string; @@ -52,9 +51,6 @@ const MeterAssetWindow = (props: IProps) => { const MeterAssetController = new GenericController(`${homePath}api/OpenXDA/DetailedMeterAsset/${props.Meter.ID}`, "AssetName", true); const PagingID = 'MeterAssetPage' - const settings = useAppSelector(SystemCenterSettingSlice.Data); - const settingStatus = useAppSelector(SystemCenterSettingSlice.Status); - const [assetTypes, setAssetTypes] = React.useState([]); const [newEdit, setNewEdit] = React.useState('New'); @@ -79,11 +75,6 @@ const MeterAssetWindow = (props: IProps) => { const [pageInfo, setPageInfo] = React.useState<{ RecordsPerPage: number, NumberOfPages: number, TotalRecords: number }>({ RecordsPerPage: 0, NumberOfPages: 0, TotalRecords: 0 }); const [pageState, setPageState] = React.useState<'error' | 'idle' | 'loading'>('idle'); - React.useEffect(() => { - if (settingStatus == 'unintiated' || settingStatus == 'changed') - dispatch(SystemCenterSettingSlice.Fetch()); - }, [settingStatus]); - React.useEffect(() => { let h = getAssetTypes() h.done((data: Array) => { From 2fdda1f41d0b29f7485bbf8f0340debc9fd01b36 Mon Sep 17 00:00:00 2001 From: Collins Self Date: Wed, 20 Nov 2024 09:30:03 -0500 Subject: [PATCH 3/3] Removed newtab Co-authored-by: Christoph Lackner <52460212+clackner-gpa@users.noreply.github.com> Signed-off-by: Collins Self --- .../wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx index 9dee13d98..55f5f1971 100644 --- a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx +++ b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/Meter/MeterAsset.tsx @@ -164,7 +164,7 @@ const MeterAssetWindow = (props: IProps) => { HeaderStyle={{ width: 'auto' }} RowStyle={{ width: 'auto' }} Content={({ item, field }) => - + {item[field]} } > Key