@@ -21,6 +21,11 @@ import Skeleton from 'react-loading-skeleton'
21
21
import { UniversalSearch } from 'src/components/utilities/UniversalSearch'
22
22
import { ActionContentCard , ListGroupContentCard } from 'src/components/contentcards'
23
23
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'
24
29
25
30
const Home = ( ) => {
26
31
const currentTenant = useSelector ( ( state ) => state . app . currentTenant )
@@ -169,7 +174,28 @@ const Home = () => {
169
174
< CCol >
170
175
< p className = "fw-lighter" > AD Connect Status</ p >
171
176
{ 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
+ ) }
173
199
</ CCol >
174
200
< CCol >
175
201
< p className = "fw-lighter" > Domain(s)</ p >
@@ -181,14 +207,21 @@ const Home = () => {
181
207
< CCol >
182
208
< p className = "fw-lighter" > Capabilities</ p >
183
209
{ 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
+ ) ) }
192
225
</ CCol >
193
226
</ CRow >
194
227
< CRow className = "mb-3" >
0 commit comments