diff --git a/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx b/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx
index cebd9afbb..bc8f7ab75 100644
--- a/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx
+++ b/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx
@@ -175,6 +175,9 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
return true;
};
+ const canEdit = currentUser.userType === UserType.admin;
+ const isPartner = currentUser.userType === UserType.partner;
+
return (
<>
{openModalDeleteInstallation && (
@@ -276,6 +279,7 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
onChange={handleChange}
variant="outlined"
fullWidth
+ inputProps={{ readOnly: !canEdit }}
/>
@@ -288,8 +292,9 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
onChange={handleChange}
variant="outlined"
fullWidth
- required
- error={formValues.region === ''}
+ required={canEdit}
+ error={canEdit && formValues.region === ''}
+ inputProps={{ readOnly: !canEdit }}
/>
@@ -305,8 +310,9 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
onChange={handleChange}
variant="outlined"
fullWidth
- required
- error={formValues.location === ''}
+ required={canEdit}
+ error={canEdit && formValues.location === ''}
+ inputProps={{ readOnly: !canEdit }}
/>
@@ -319,23 +325,26 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
onChange={handleChange}
variant="outlined"
fullWidth
- required
- error={formValues.country === ''}
+ required={canEdit}
+ error={canEdit && formValues.country === ''}
+ inputProps={{ readOnly: !canEdit }}
/>
-
-
- }
- name="vpnIp"
- value={formValues.vpnIp}
- onChange={handleChange}
- variant="outlined"
- fullWidth
- />
-
+ {canEdit && (
+
+
+ }
+ name="vpnIp"
+ value={formValues.vpnIp}
+ onChange={handleChange}
+ variant="outlined"
+ fullWidth
+ />
+
+ )}
{DeviceTypes.map((device) => (
-
-
- }
- name="serialNumber"
- value={formValues.serialNumber}
- onChange={handleChange}
- variant="outlined"
- fullWidth
- />
-
-
-
-
- }
- name="inverterSN"
- value={formValues.inverterSN}
- onChange={handleChange}
- variant="outlined"
- fullWidth
- />
-
-
-
-
- }
- name="dataloggerSN"
- value={formValues.dataloggerSN}
- onChange={handleChange}
- variant="outlined"
- fullWidth
- />
-
-
-
-
- }
- name="batteryClusterNumber"
- value={formValues.batteryClusterNumber}
- onChange={handleChange}
- variant="outlined"
- fullWidth
- />
-
-
-
-
- }
- name="batteryNumber"
- type="text"
- value={batteryNumber === 0 ? '' : batteryNumber}
- onChange={handleBatteryNumberChange}
- variant="outlined"
- fullWidth
- placeholder="Enter number of batteries"
- />
-
-
- {batteryNumber > 0 &&
- batterySerialNumbers.map((serialNumber, index) => (
-
+ {(canEdit || isPartner) && (
+ <>
+
- handleBatterySerialNumberChange(index, e.target.value)
+ label={
+
}
- onKeyDown={(e) => handleBatterySnKeyDown(e, index)}
- inputRef={(el) => (batterySnRefs.current[index] = el)}
+ name="serialNumber"
+ value={formValues.serialNumber}
+ onChange={handleChange}
variant="outlined"
fullWidth
- placeholder="Scan or enter serial number"
+ inputProps={{ readOnly: !canEdit }}
/>
- ))}
+
+
+
+ }
+ name="inverterSN"
+ value={formValues.inverterSN}
+ onChange={handleChange}
+ variant="outlined"
+ fullWidth
+ inputProps={{ readOnly: !canEdit }}
+ />
+
+
+
+
+ }
+ name="dataloggerSN"
+ value={formValues.dataloggerSN}
+ onChange={handleChange}
+ variant="outlined"
+ fullWidth
+ inputProps={{ readOnly: !canEdit }}
+ />
+
+
+
+
+ }
+ name="batteryClusterNumber"
+ value={formValues.batteryClusterNumber}
+ onChange={handleChange}
+ variant="outlined"
+ fullWidth
+ inputProps={{ readOnly: !canEdit }}
+ />
+
+
+
+
+ }
+ name="batteryNumber"
+ type="text"
+ value={batteryNumber === 0 ? '' : batteryNumber}
+ onChange={handleBatteryNumberChange}
+ variant="outlined"
+ fullWidth
+ placeholder={canEdit ? 'Enter number of batteries' : ''}
+ inputProps={{ readOnly: !canEdit }}
+ />
+
+
+ {batteryNumber > 0 &&
+ batterySerialNumbers.map((serialNumber, index) => (
+
+
+ handleBatterySerialNumberChange(index, e.target.value)
+ }
+ onKeyDown={(e) => handleBatterySnKeyDown(e, index)}
+ inputRef={(el) => (batterySnRefs.current[index] = el)}
+ variant="outlined"
+ fullWidth
+ placeholder={canEdit ? 'Scan or enter serial number' : ''}
+ inputProps={{ readOnly: !canEdit }}
+ />
+
+ ))}
+ >
+ )}
- {currentUser.userType == UserType.admin && (
+ {canEdit && (
<>
-
+ {canEdit && (
+
+ )}
- {currentUser.userType == UserType.admin && (
+ {canEdit && (
-
- }
- />
+ {currentUser.userType !== UserType.client && (
+
+ }
+ />
+ )}
-
- }
- >
+ {currentUser.userType !== UserType.client && (
+
+ }
+ />
+ )}
{currentUser.userType == UserType.admin && (
- {currentUser.userType == UserType.admin && (
-
- }
- />
- )}
+
+ }
+ />
},
-
{
value: 'manage',
label: (
@@ -128,14 +127,12 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
/>
)
},
-
{
value: 'information',
label: (
)
},
-
{
value: 'configuration',
label: (
@@ -164,6 +161,45 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
)
}
]
+ : currentUser.userType == UserType.partner
+ ? [
+ {
+ value: 'live',
+ label:
+ },
+ {
+ value: 'overview',
+ label:
+ },
+ {
+ value: 'batteryview',
+ label: (
+
+ )
+ },
+ {
+ value: 'log',
+ label:
+ },
+ {
+ value: 'information',
+ label: (
+
+ )
+ },
+ {
+ value: 'report',
+ label: (
+
+ )
+ }
+ ]
: [
{
value: 'live',
@@ -178,14 +214,24 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
label: (
)
+ },
+ {
+ value: 'report',
+ label: (
+
+ )
}
];
- const tabs =
+ const inInstallationView =
currentTab != 'list' &&
currentTab != 'tree' &&
- !location.pathname.includes('folder') &&
- currentUser.userType == UserType.admin
+ !location.pathname.includes('folder');
+
+ const tabs = inInstallationView && currentUser.userType == UserType.admin
? [
{
value: 'list',
@@ -216,7 +262,6 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
value: 'log',
label:
},
-
{
value: 'manage',
label: (
@@ -226,7 +271,6 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
/>
)
},
-
{
value: 'information',
label: (
@@ -261,10 +305,7 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
)
}
]
- : currentTab != 'list' &&
- currentTab != 'tree' &&
- !location.pathname.includes('folder') &&
- currentUser.userType == UserType.client
+ : inInstallationView && currentUser.userType == UserType.partner
? [
{
value: 'list',
@@ -282,12 +323,67 @@ function SodioHomeInstallationTabs(props: SodioHomeInstallationTabsProps) {
value: 'overview',
label:
},
-
+ {
+ value: 'batteryview',
+ label: (
+
+ )
+ },
+ {
+ value: 'log',
+ label:
+ },
{
value: 'information',
label: (
)
+ },
+ {
+ value: 'report',
+ label: (
+
+ )
+ }
+ ]
+ : inInstallationView && currentUser.userType == UserType.client
+ ? [
+ {
+ value: 'list',
+ icon:
+ },
+ {
+ value: 'tree',
+ icon:
+ },
+ {
+ value: 'live',
+ label:
+ },
+ {
+ value: 'overview',
+ label:
+ },
+ {
+ value: 'information',
+ label: (
+
+ )
+ },
+ {
+ value: 'report',
+ label: (
+
+ )
}
]
: [