Skip to content

Commit 15b22ae

Browse files
Merge pull request #1516 from johnduprey/dev
Tenant overview tweaks
2 parents 423890b + 81c9f27 commit 15b22ae

File tree

1 file changed

+42
-9
lines changed

1 file changed

+42
-9
lines changed

src/views/home/Home.js

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import Skeleton from 'react-loading-skeleton'
2121
import { UniversalSearch } from 'src/components/utilities/UniversalSearch'
2222
import { ActionContentCard, ListGroupContentCard } from 'src/components/contentcards'
2323
import { useSelector } from 'react-redux'
24+
import TimeAgo from 'javascript-time-ago'
25+
26+
import en from 'javascript-time-ago/locale/en.json'
27+
TimeAgo.addDefaultLocale(en)
28+
import ReactTimeAgo from 'react-time-ago'
2429

2530
const Home = () => {
2631
const currentTenant = useSelector((state) => state.app.currentTenant)
@@ -169,7 +174,28 @@ const Home = () => {
169174
<CCol>
170175
<p className="fw-lighter">AD Connect Status</p>
171176
{isLoadingOrg && <Skeleton />}
172-
{JSON.stringify(organization?.onPremisesSyncStatus)}
177+
{!isLoadingOrg && organization?.onPremisesSyncEnabled ? (
178+
<>
179+
<li>
180+
<span class="me-1">Directory Sync:</span>
181+
{organization?.onPremisesLastSyncDateTime ? (
182+
<ReactTimeAgo date={organization?.onPremisesLastSyncDateTime} />
183+
) : (
184+
'Never'
185+
)}
186+
</li>
187+
<li>
188+
<span class="me-1">Password Sync:</span>
189+
{organization?.onPremisesLastPasswordSyncDateTime ? (
190+
<ReactTimeAgo date={organization?.onPremisesLastPasswordSyncDateTime} />
191+
) : (
192+
'Never'
193+
)}
194+
</li>
195+
</>
196+
) : (
197+
'Disabled'
198+
)}
173199
</CCol>
174200
<CCol>
175201
<p className="fw-lighter">Domain(s)</p>
@@ -181,14 +207,21 @@ const Home = () => {
181207
<CCol>
182208
<p className="fw-lighter">Capabilities</p>
183209
{isLoadingOrg && <Skeleton />}
184-
{organization &&
185-
JSON.stringify(organization.assignedPlans).includes('AADPremiumService') && (
186-
<li>AAD Premium</li>
187-
)}
188-
{organization &&
189-
JSON.stringify(organization.assignedPlans).includes('WindowsDefenderATP') && (
190-
<li>Windows Defender</li>
191-
)}
210+
{organization?.assignedPlans
211+
.filter((p) => p.capabilityStatus == 'Enabled')
212+
.reduce((plan, curr) => {
213+
if (!plan.includes(curr.service)) {
214+
plan.push(curr.service)
215+
}
216+
return plan
217+
}, [])
218+
.map((plan) => (
219+
<>
220+
{plan == 'exchange' && <li>Exchange</li>}
221+
{plan == 'AADPremiumService' && <li>AAD Premium</li>}
222+
{plan == 'WindowsDefenderATP' && <li>Windows Defender</li>}
223+
</>
224+
))}
192225
</CCol>
193226
</CRow>
194227
<CRow className="mb-3">

0 commit comments

Comments
 (0)