Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Udmi web app updates #484

Merged
merged 712 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
712 commits
Select commit Hold shift + click to select a range
1b86b01
Merge pull request #153 from Buildings-IOT/updating-source-functions
naveenlakshmi May 17, 2022
c80fbe8
testing dist foloder
naveenlakshmi May 17, 2022
357b87f
testing sourc
naveenlakshmi May 17, 2022
03a2171
Merge pull request #154 from Buildings-IOT/updating-source-functions
naveenlakshmi May 17, 2022
e1e8ebc
testing with source
naveenlakshmi May 17, 2022
7295016
Merge pull request #155 from Buildings-IOT/updating-source-functions
naveenlakshmi May 17, 2022
0d7ddb1
testing source
naveenlakshmi May 17, 2022
bfffc5e
Merge pull request #156 from Buildings-IOT/updating-source-functions
naveenlakshmi May 17, 2022
7871f40
testing source with zip
naveenlakshmi May 17, 2022
d8de928
Merge pull request #157 from Buildings-IOT/updating-source-functions
naveenlakshmi May 17, 2022
eefca34
#1092-adjusted tests
May 17, 2022
4dd4b3d
changing index.zip to dist.zip
naveenlakshmi May 17, 2022
6903434
Merge pull request #158 from Buildings-IOT/updating-source-functions
naveenlakshmi May 17, 2022
7555b26
Merge pull request #152 from Buildings-IOT/#1092-GAR4-DateFormatChang…
mspratt-biot May 17, 2022
13c1f9e
#1094-increased whitespace
May 18, 2022
de78ee9
changing source foloder
naveenlakshmi May 18, 2022
2ffef98
Merge pull request #160 from Buildings-IOT/updating-source-functions
naveenlakshmi May 18, 2022
ce8e2d7
Cleanup artifacts from checkin
pcarriere-biot May 18, 2022
869cfcd
some more build cleanups
pcarriere-biot May 18, 2022
75933d6
testing gcf
naveenlakshmi May 18, 2022
80d8eb9
testing
naveenlakshmi May 18, 2022
07aeba3
created build.yml for event handler
naveenlakshmi May 18, 2022
f1d43ed
#1091-increased the font sizes according to gar4
May 18, 2022
d72b6e3
#1093-adjusted filter bar and other items to increase contrast
May 19, 2022
3f885a2
Merge pull request #162 from Buildings-IOT/#1093-ContrastGar4
mspratt-biot May 19, 2022
b938dcb
Merge pull request #161 from Buildings-IOT/#1091-IncreaseFontSizes
mspratt-biot May 19, 2022
36b05ec
Merge pull request #159 from Buildings-IOT/#1094-IncreaseWhitespace
mspratt-biot May 19, 2022
7a9c1f1
#1095-moved location of devices button
May 19, 2022
d3d9bdd
#1095-changed h1 to h2 for UDMI 'logo'
May 19, 2022
1b252c2
removed functions.tf
nkotibiot May 19, 2022
67760ee
Merge pull request #164 from Buildings-IOT/functions-event
nkotibiot May 19, 2022
dcef11a
Merge pull request #163 from Buildings-IOT/#1095-AdjustDevicesLinkToM…
mspratt-biot May 19, 2022
8882bae
Trigger Merge pipeline when spcific dir/sub dir changed
nkotibiot May 19, 2022
e87b37e
Merge pull request #165 from Buildings-IOT/functions-event
nkotibiot May 19, 2022
66756cb
#1090-fixed incorrect use of mat-sort-header
May 19, 2022
7b332c5
Merge pull request #166 from Buildings-IOT/#1090-EnsureKeyboardIntera…
mspratt-biot May 20, 2022
8ea0b4d
testing gcf
naveenlakshmi May 25, 2022
4bcfaba
testing gcf
naveenlakshmi May 25, 2022
e855446
Handle pointset messages (#167)
slevertbiot May 25, 2022
16f67f7
GCP clud function fixes
pcarriere-biot May 25, 2022
47ff552
Handle pointset messages (#168)
slevertbiot May 25, 2022
47c3289
GCP Function work
pcarriere-biot May 25, 2022
4851b91
Configured cloud function deployment
nkotibiot May 25, 2022
9af07be
merged from master
nkotibiot May 25, 2022
862db2f
Merge pull request #169 from Buildings-IOT/create-gcf
nkotibiot May 25, 2022
158c833
Setup env variables
nkotibiot May 25, 2022
9c20830
Merge pull request #170 from Buildings-IOT/create-gcf
nkotibiot May 25, 2022
5d9773a
Changed env varible
nkotibiot May 26, 2022
8cf4e83
set up env variable
nkotibiot May 26, 2022
3c7de46
cleanup googlefunction variables
nkotibiot May 26, 2022
e00bc54
updated event handler function
nkotibiot May 26, 2022
fd2c859
Merge pull request #171 from Buildings-IOT/env-mongo
nkotibiot May 26, 2022
f6430f0
Removed license from package.json
pcarriere-biot May 27, 2022
54f3121
updated env varibles
nkotibiot May 27, 2022
0d79e18
Merge pull request #172 from Buildings-IOT/event-handler-env
nkotibiot May 27, 2022
167152b
testing event-handler ci
naveenlakshmi May 31, 2022
02c7775
testing ci
naveenlakshmi May 31, 2022
53f1c8f
Merging in master from faucetsdn/udmi
slevertbiot May 31, 2022
6d791c2
Merge branch 'master' of github.com:Buildings-IOT/udmi
slevertbiot May 31, 2022
51f4471
Fixing static data pagination by using correct variable (#174)
slevertbiot Jun 1, 2022
66d4a60
testing gcf ci
naveenlakshmi Jun 1, 2022
177574e
testing gcf ci
naveenlakshmi Jun 1, 2022
87b567d
Merge pull request #175 from Buildings-IOT/creating-gcf-ci/cd
naveenlakshmi Jun 1, 2022
e79bdd3
testing gcf ci
naveenlakshmi Jun 1, 2022
952a8f0
Merge pull request #176 from Buildings-IOT/creating-gcf-ci/cd
naveenlakshmi Jun 1, 2022
692ad26
Handle repetitive pointset messages (#173)
slevertbiot Jun 1, 2022
10c1d4a
enabled automatic deployment in staging
nkotibiot Jun 2, 2022
9133695
Merge pull request #178 from Buildings-IOT/event-handler
nkotibiot Jun 2, 2022
566e599
changing mongo host
naveenlakshmi Jun 2, 2022
aad8024
Merge pull request #179 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 2, 2022
2037e62
updating Mongo-host
naveenlakshmi Jun 2, 2022
7e3e763
Merge pull request #180 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 2, 2022
a370da1
testing gcf ci
naveenlakshmi Jun 2, 2022
307e984
removing uneeded zip (#177)
slevertbiot Jun 3, 2022
74c2e63
testing ci/cd for gcf
naveenlakshmi Jun 3, 2022
dcaf508
testing ci/cd for gcf
naveenlakshmi Jun 3, 2022
386a83a
ci/cd/gcf
naveenlakshmi Jun 3, 2022
f478e27
Merge pull request #181 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 3, 2022
e9a0c9d
testing gcf/ci/cd
naveenlakshmi Jun 3, 2022
ec645fc
Merge pull request #182 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 3, 2022
370e29f
testing gcf
naveenlakshmi Jun 3, 2022
82d6094
Merge pull request #183 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 3, 2022
ac045f5
creating ci/cd/gcf
naveenlakshmi Jun 3, 2022
93af402
Merge pull request #185 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 3, 2022
d131ece
testing ci/cd-gcf
naveenlakshmi Jun 3, 2022
2801861
Merge pull request #186 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 3, 2022
e0f8b98
testing ci/cd
naveenlakshmi Jun 3, 2022
39623a7
Merge pull request #187 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 3, 2022
505e77e
changing mongo access admin to udmi
naveenlakshmi Jun 6, 2022
3470ac6
updated variable in api
nkotibiot Jun 6, 2022
60dad30
Merge pull request #188 from Buildings-IOT/changing-Mongo-host
naveenlakshmi Jun 6, 2022
40f4126
Merge pull request #189 from Buildings-IOT/api-variable
nkotibiot Jun 6, 2022
86d0291
Adding log to see incoming message (#190)
slevertbiot Jun 6, 2022
50a1e94
Fixed readme
pcarriere-biot Jun 6, 2022
aaac039
Update README.md
slevertbiot Jun 6, 2022
873efe5
Add log to help debug (#191)
slevertbiot Jun 6, 2022
fe20460
updated variable
nkotibiot Jun 6, 2022
8482264
Merge pull request #192 from Buildings-IOT/api-variable
nkotibiot Jun 6, 2022
f3b6d25
Fixing env var key for mongor password (#193)
slevertbiot Jun 7, 2022
f6ea118
updating mongo_host
naveenlakshmi Jun 7, 2022
544816e
Merge pull request #194 from Buildings-IOT/updating-mongohost
naveenlakshmi Jun 7, 2022
19fd7cc
Fix env var (#195)
slevertbiot Jun 8, 2022
99b305c
Fixing the data so that the tags and points are populated with empty …
slevertbiot Jun 8, 2022
90da14f
Fixing data (#197)
slevertbiot Jun 8, 2022
4b10c76
changed usage of @import to @use
Jun 8, 2022
d6506fa
Merge pull request #198 from Buildings-IOT/ChangeUseOf@ImportTo@Use
mspratt-biot Jun 8, 2022
139fc8c
#1177-added details about envs
Jun 9, 2022
f2bf2d3
Merge pull request #199 from Buildings-IOT/#1177-EnvVariablesDocs
mspratt-biot Jun 9, 2022
fa58c0b
Handle env variable by not throwing exception if the var is not avail…
slevertbiot Jun 9, 2022
d420f7a
#1179-removed state from devices service
Jun 10, 2022
a46a832
#1179-fixed tests, removed use of fragments for testing purposes
Jun 10, 2022
165066c
Merge pull request #201 from Buildings-IOT/#1179-DeviceListSometimesS…
mspratt-biot Jun 13, 2022
2bdffe1
#1182-changed the filter icon
Jun 10, 2022
285dc88
Merge pull request #202 from Buildings-IOT/#1182-FilterIconChange
mspratt-biot Jun 13, 2022
164afbe
#1181-changed theme colors, adjusted nav
Jun 13, 2022
ecd926e
Merge pull request #203 from Buildings-IOT/#1181-ColorBlindThemes
mspratt-biot Jun 13, 2022
3410a6c
#1180-moved search filter down
Jun 14, 2022
0ea8d30
#1180-made clear filters work
Jun 14, 2022
242fe61
#1180-fixed clearing/opening/closing autocomplete
Jun 14, 2022
657dbae
#1180-made ux behave nicer for autocomplete when clearing
Jun 14, 2022
818ed1b
#1180-adjusted comments
Jun 14, 2022
290a6e1
#1180-adjusted tests
Jun 15, 2022
5ad596f
#1180-added test for when clearing all filters
Jun 15, 2022
7876bdc
#1180-removed unused css import
Jun 15, 2022
21b3ed3
Terraform adjustments for successful deployment
pcarriere-biot Jun 15, 2022
3dcf245
Removed Creds
pcarriere-biot Jun 15, 2022
6c9524b
Updated gitignore
pcarriere-biot Jun 15, 2022
d9c92d5
Merge pull request #204 from Buildings-IOT/#1180-AugmentSearchFilter
mspratt-biot Jun 15, 2022
094911b
Fixed build issue in gcp
nkotibiot Jul 8, 2022
737964a
Merge pull request #206 from Buildings-IOT/gcp-build
nkotibiot Jul 8, 2022
0d581de
Adjust scripts and readmes (#205)
slevertbiot Jul 8, 2022
0da79a0
Merge branch 'master' of github.com:faucetsdn/udmi
slevertbiot Jul 8, 2022
1098476
Merge remote-tracking branch 'upstream/master'
slevertbiot Aug 2, 2022
e00520e
Merge remote-tracking branch 'upstream/master'
slevertbiot Aug 3, 2022
5a3c06f
Rename jest mongodb config file (#207)
slevertbiot Aug 4, 2022
ddf6597
Introducing a docker container to run tests (#208)
slevertbiot Aug 4, 2022
6201272
Merge remote-tracking branch 'upstream/master'
slevertbiot Aug 5, 2022
2a22fee
removing devices.json from branch, this can be generated when needed
slevertbiot Aug 5, 2022
9418183
Handle validation message (#209)
slevertbiot Aug 9, 2022
f22baa9
Handle validation message (#210)
slevertbiot Aug 11, 2022
334cfb8
Update device key (#211)
slevertbiot Aug 12, 2022
c283957
Merging faucetsdn into our master
slevertbiot Aug 12, 2022
444ed3c
Merge remote-tracking branch 'upstream/master'
slevertbiot Aug 15, 2022
bb4aea4
handling braoder set of incoming validation messages (#212)
slevertbiot Aug 16, 2022
636613a
Handling basic site message, refactored to remove duplicated logic (#…
slevertbiot Aug 18, 2022
c41c38a
Handle site errors (#216)
slevertbiot Aug 19, 2022
c9ad1ec
#1341-setup the sites screen
Aug 17, 2022
b903c5c
#1341-fixed tests
Aug 18, 2022
7363ae3
#1341-added :void
Aug 19, 2022
956d483
#1341-renamed the sites query and created a proper sites query
Aug 17, 2022
a2fdb21
#1341-fixed/added tests
Aug 19, 2022
94aafaf
#1341-created a generic dao
Aug 22, 2022
a7ccfbd
#1341-moved folders around
Aug 22, 2022
5acc361
#1341-added lodash lib, moved out common logic
Aug 22, 2022
88423be
#1341-adjusted imports
Aug 22, 2022
9d13011
#1341-fixed tests
Aug 22, 2022
d77114d
#1341-added tests
Aug 23, 2022
86660dc
#1341-added more tests
Aug 23, 2022
a9202ca
#1341-renamed searchOptions type
Aug 23, 2022
08249e9
#1341-fixed tests
Aug 25, 2022
619c498
Merge pull request #218 from Buildings-IOT/#1341-SetupSitesApiPart2
mspratt-biot Aug 26, 2022
229f8f2
Merge pull request #214 from Buildings-IOT/#1341-SetupSitesScreen
mspratt-biot Aug 26, 2022
d6dfe1f
Persisting all Site Validation Messages (#219)
slevertbiot Aug 31, 2022
3d0d5b1
Adding device validation history (#221)
slevertbiot Sep 1, 2022
543169c
Adding device validation history (#222)
slevertbiot Sep 1, 2022
785984a
Merge remote-tracking branch 'upstream/master'
slevertbiot Sep 6, 2022
2c663c1
#1367-added more columns to sites list view by adding fields to schema
Sep 9, 2022
82182b8
#1367-fixing linting
Sep 9, 2022
4d3598e
#1367-testing git hook
Sep 9, 2022
358c360
#1367-testing git hook
Sep 9, 2022
9631a90
#1367-testing git hook
Sep 9, 2022
01a568d
#1367-testing git hook
Sep 9, 2022
78a7e42
#1367-testing git hook
Sep 9, 2022
7823a94
#1367-testing git hook
Sep 9, 2022
293b8a0
#1367-testing git hook
Sep 9, 2022
bf652d0
#1367-added type for data source
Sep 9, 2022
dd740ca
#1367-refactored sitesDS
Sep 9, 2022
a16cc84
#1367-code cleanup
Sep 9, 2022
9e60f7b
#1367-added tests
Sep 12, 2022
88a108e
#1367-adjusting PR comments
Sep 13, 2022
0b24758
#1403-added sorting paging and filtering
Sep 13, 2022
8501603
Merge pull request #223 from Buildings-IOT/#1367-AddColumnsToSitesLis…
mspratt-biot Sep 13, 2022
f5e613c
Merge pull request #224 from Buildings-IOT/#1403-SortSearchPageSites
mspratt-biot Sep 13, 2022
aa8ca01
#1344-created site details page
Sep 13, 2022
b0f8de2
#1344-default to first tab on site details screen
Sep 13, 2022
cb2f2d7
#1419-added navigation service to hold page title
Sep 14, 2022
5f44833
#1419-added tests
Sep 14, 2022
8fc6ca0
#1418-added validation card
Sep 14, 2022
4781285
#1418-expose validation property on device and site
Sep 14, 2022
072a6a4
#1418-added tests
Sep 14, 2022
df2d29c
#1418-return value instead of undefined when not supplied to parse pipe
Sep 14, 2022
cc1ed6a
Merge pull request #225 from Buildings-IOT/#1344-SiteDetails
mspratt-biot Sep 15, 2022
0b226ab
Merge pull request #226 from Buildings-IOT/#1419-MoveSiteAndDevicesNa…
mspratt-biot Sep 15, 2022
64c0331
Merge pull request #227 from Buildings-IOT/#1418-AddValidationBoxToSi…
mspratt-biot Sep 15, 2022
3dd5fa6
1416-made devices component work stand alone and under sites
Sep 15, 2022
f6cc262
#1416-adjusted UI to supply filter on autocomplete options
Sep 15, 2022
8109f2a
#1416-adjusted API to handle filter on auto complete options
Sep 15, 2022
526dc3b
#1416-added tests
Sep 16, 2022
6e0dc21
#1416-added tests for api
Sep 16, 2022
e21865f
#1423-added resolved device fields
Sep 16, 2022
e7c87c9
#1423-display more device columns
Sep 16, 2022
a908cdb
#1423-fixed web tests
Sep 16, 2022
c4fab69
#1423-added tests for api
Sep 19, 2022
d169e45
#1447-added device errors view
Sep 19, 2022
3d1f261
Merge pull request #228 from Buildings-IOT/#1416-ListDevicesUnderSite
mspratt-biot Sep 19, 2022
34db7bc
Merge pull request #229 from Buildings-IOT/#1423-AddColumnsToDevices
mspratt-biot Sep 19, 2022
71b4acb
#1447-added tests
Sep 20, 2022
11af303
Merge pull request #230 from Buildings-IOT/#1447-DisplayDeviceErrors
mspratt-biot Sep 20, 2022
a140008
#1457-removed concept of site id
Sep 21, 2022
a87647d
#1457-fixed api
Sep 21, 2022
0c339e6
#1457-fixed tests
Sep 21, 2022
e619cfb
#1457-made Site have key field name
Sep 21, 2022
65cd5fb
updating model to match expectations of api and ui (#231)
slevertbiot Sep 21, 2022
36bc2db
Merge pull request #232 from Buildings-IOT/#1457-AdjustStagingDataInM…
mspratt-biot Sep 21, 2022
e023fb6
#1462-upgraded angular from 13 to 14
Sep 26, 2022
5c42b25
#1462-upgraded angular material
Sep 26, 2022
86eb543
#1462-upgraded social login
Sep 26, 2022
88f6ecf
#1462-now redirect using guard
Sep 26, 2022
f944c15
Merge pull request #233 from Buildings-IOT/#1462-UpdateGoogleLogin
mspratt-biot Sep 27, 2022
ce71690
Merge remote-tracking branch 'upstream/master'
Sep 27, 2022
b23b878
Handling validation event with a folder of type update (#234)
slevertbiot Sep 29, 2022
8ee3ace
updated node version
naveenlakshmi Sep 29, 2022
39a2492
updated node version
naveenlakshmi Sep 29, 2022
2cfb4d1
Merge pull request #235 from Buildings-IOT/updated-nod
naveenlakshmi Sep 29, 2022
df3805c
#1417-made rows expandable
Oct 3, 2022
91d8568
#1417-added link of device name, made row clickable
Oct 3, 2022
d5d1bf8
#1417-removed row click
Oct 3, 2022
1026661
#1417-made errors details row simpler
Oct 3, 2022
0992551
#1417-added order by pipe
Oct 4, 2022
4a122c1
#1417-fixed tests
Oct 4, 2022
41c0eb7
Merge pull request #236 from Buildings-IOT/#1417-MakeDevicesRowsExpan…
mspratt-biot Oct 4, 2022
941b0ef
#1402-made site rows expandable
Oct 5, 2022
87c3611
#1402-cleaned up code
Oct 5, 2022
379efb6
Making sure null point units do not throw an exception in the API (#237)
slevertbiot Oct 5, 2022
c861150
Merge remote-tracking branch 'upstream/master'
slevertbiot Oct 5, 2022
16eb8bd
#1402-added count of top errors
Oct 5, 2022
276b451
#1402-added tests
Oct 6, 2022
725e3dc
#1402-expose API to return device errors on a site
Oct 6, 2022
07d6518
Merge pull request #238 from Buildings-IOT/#1402-ExpandSitesRowsToSho…
mspratt-biot Oct 6, 2022
b6a8d7b
#1527-changed columns to be objects
Oct 7, 2022
d4de1d0
Merge pull request #239 from Buildings-IOT/#1527-OmitSortingOnResolve…
mspratt-biot Oct 12, 2022
07cb7d0
#1609-logout user after idToken expires, properly display device details
Oct 14, 2022
828fec6
#1609-adjusted site details to be consistent with table
Oct 14, 2022
6186097
#1605-table cell now breaks word
Oct 14, 2022
f60d2d4
#1605-made devices operational field not always show no when null
Oct 14, 2022
cb0be23
Merge pull request #240 from Buildings-IOT/#1609-GracefullyLogoutUser
mspratt-biot Oct 17, 2022
3d27b0f
Merge remote-tracking branch 'upstream/master'
Oct 19, 2022
837e6d5
fixing merge
Oct 19, 2022
3aaa2c8
removed cloud gcp file
Oct 19, 2022
56895e5
removing files not needed for merge into upstream
Oct 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion udmif/api/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cache:
include:
- project: 'buildings-iot/templates/cicd_pipelines'
ref: main
file: node.yml
file: node16.yml

stages:
- build
Expand Down
10 changes: 5 additions & 5 deletions udmif/api/src/__tests__/device/MockDeviceDataSource.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphQLDataSource } from 'apollo-datasource-graphql/dist/GraphQLDataSource';
import { sum } from 'lodash';
import { DeviceError } from '../../common/model';
import { Device, DevicesResponse, Point } from '../../device/model';
import { createDevices } from './data';

Expand Down Expand Up @@ -58,11 +58,11 @@ export default class MockDeviceDataSource extends GraphQLDataSource<object> {
};
}

async getDeviceErrorsCountBySite(siteName: string): Promise<number> {
async getDeviceErrorsBySite(siteName: string): Promise<DeviceError[]> {
const { devices } = await this.getDevicesBySite(siteName);

return devices.reduce((n: number, device: Device) => {
return sum([n, device.validation?.errors.length]);
}, 0);
return devices.reduce((errors: DeviceError[], device: Device) => {
return errors.concat(device.validation?.errors ?? []);
}, []);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Object {
"data": Object {
"site": Object {
"correctDevicesCount": 1,
"deviceErrors": Array [],
"errorDevicesCount": 1,
"extraDevicesCount": 0,
"lastValidated": "2022-07-16T18:27:19Z",
Expand Down
4 changes: 4 additions & 0 deletions udmif/api/src/__tests__/site/resolve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const QUERY_SITE = gql`
extraDevicesCount
lastValidated
percentValidated
deviceErrors {
timestamp
message
}
totalDeviceErrorsCount
validation
}
Expand Down
8 changes: 8 additions & 0 deletions udmif/api/src/common/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ export interface Filter {
operator: string;
value: string;
}

export interface DeviceError {
message: string;
detail?: string;
category: string;
timestamp: string;
level: number;
}
10 changes: 5 additions & 5 deletions udmif/api/src/device/DeviceDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
DistinctSearchOptions,
ValidatedSearchOptions,
SearchOptions,
DeviceError,
} from '../common/model';
import { sum } from 'lodash';

export class DeviceDataSource extends GraphQLDataSource {
constructor(private deviceDAO: DAO<Device>) {
Expand Down Expand Up @@ -70,11 +70,11 @@ export class DeviceDataSource extends GraphQLDataSource {
});
}

async getDeviceErrorsCountBySite(siteName: string): Promise<number> {
async getDeviceErrorsBySite(siteName: string): Promise<DeviceError[]> {
const { devices } = await this.getDevicesBySite(siteName);

return devices.reduce((n: number, device: Device) => {
return sum([n, device.validation?.errors.length]);
}, 0);
return devices.reduce((errors: DeviceError[], device: Device) => {
return errors.concat(device.validation?.errors ?? []);
}, []);
}
}
7 changes: 5 additions & 2 deletions udmif/api/src/site/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ export const resolvers = {
]) / ((await deviceDS.getDevicesBySite(site.name)).totalFilteredCount || 1)
);
},
totalDeviceErrorsCount: (site: Site, _args, { dataSources: { deviceDS } }: ApolloContext) => {
return deviceDS.getDeviceErrorsCountBySite(site.name);
deviceErrors: (site: Site, _args, { dataSources: { deviceDS } }: ApolloContext) => {
return deviceDS.getDeviceErrorsBySite(site.name);
},
totalDeviceErrorsCount: async (site: Site, _args, { dataSources: { deviceDS } }: ApolloContext) => {
return (await deviceDS.getDeviceErrorsBySite(site.name)).length;
},
validation: (site: Site) => {
return JSON.stringify(site.validation);
Expand Down
14 changes: 14 additions & 0 deletions udmif/api/src/site/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ type SitesResponse {
totalFilteredCount: Int!
}

type DeviceError {
# A human-readable one-line description of the entry
message: String!
# An optional extensive entry which can include more detail, e.g. a complete program stack-trace
detail: String
category: String!
# Timestamp the condition was triggered, or most recently updated
timestamp: String!
# The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).
level: Int!
}

type Site {
# Name of the site
name: String!
Expand All @@ -25,6 +37,8 @@ type Site {
# Percent of devices validated i.e. 0.97
percentValidated: Float!
# Total number of errors across all devices
deviceErrors: [DeviceError!]!
# Total number of errors across all devices
totalDeviceErrorsCount: Int!
# JSON validation message
validation: String
Expand Down
2 changes: 1 addition & 1 deletion udmif/event-handler/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:
include:
- project: 'buildings-iot/templates/cicd_pipelines'
ref: main
file: node.yml
file: node16.yml

stages:
- build
Expand Down
2 changes: 1 addition & 1 deletion udmif/web/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:
include:
- project: 'buildings-iot/templates/cicd_pipelines'
ref: main
file: node.yml
file: node16.yml

stages:
- build
Expand Down
3 changes: 2 additions & 1 deletion udmif/web/src/app/auth/auth.guard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TestBed } from '@angular/core/testing';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { BehaviorSubject } from 'rxjs';
import { LoginComponent } from '../login/login.component';
import { AuthGuard } from './auth.guard';
import { AuthService } from './auth.service';

Expand All @@ -16,7 +17,7 @@ describe('AuthGuard', () => {
mockAuthService.isLoggedIn$ = new BehaviorSubject<boolean | null>(null);

TestBed.configureTestingModule({
imports: [RouterTestingModule],
imports: [RouterTestingModule.withRoutes([{ path: 'login', component: LoginComponent }])],
providers: [{ provide: AuthService, useValue: mockAuthService }],
});
guard = TestBed.inject(AuthGuard);
Expand Down
4 changes: 0 additions & 4 deletions udmif/web/src/app/breadcrumb/breadcrumb.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
display: flex;
align-items: center;

a {
color: $primary;
}

.mat-icon {
color: $icon-default;
}
Expand Down
44 changes: 44 additions & 0 deletions udmif/web/src/app/common/pipes/order-by.pipe.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { OrderByPipe } from './order-by.pipe';

describe('OrderByPipe', () => {
const pipe = new OrderByPipe();

const testCases = [
{ expected: [] },
{ value: null, sortBy: null, order: null, expected: [] },
{
value: [{ name: 'device-1' }, { name: 'device-3' }, { name: 'device-2' }],
sortBy: 'name',
expected: [{ name: 'device-1' }, { name: 'device-2' }, { name: 'device-3' }],
},
{
value: [{ name: 'device-1' }, { name: 'device-3' }, { name: 'device-2' }],
sortBy: 'name',
order: 'asc',
expected: [{ name: 'device-1' }, { name: 'device-2' }, { name: 'device-3' }],
},
{
value: [{ name: 'device-1' }, { name: 'device-3' }, { name: 'device-2' }],
sortBy: 'name',
order: 'desc',
expected: [{ name: 'device-3' }, { name: 'device-2' }, { name: 'device-1' }],
},
{
value: [{ name: 'device-1' }, { name: 'device-3' }, { name: 'device-2' }],
sortBy: 'bogus',
expected: [{ name: 'device-1' }, { name: 'device-3' }, { name: 'device-2' }],
},
{
value: [{ name: 'device-1' }, { name: 'device-3' }, { name: 'device-2' }],
sortBy: 'name',
order: 'bogus',
expected: [{ name: 'device-1' }, { name: 'device-2' }, { name: 'device-3' }],
},
];

testCases.forEach((test) => {
it(`should transform ${test.value} to ${test.expected}`, () => {
expect(pipe.transform(test.value, test.sortBy, test.order as 'asc' | 'desc')).toEqual(test.expected);
});
});
});
13 changes: 13 additions & 0 deletions udmif/web/src/app/common/pipes/order-by.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Pipe, PipeTransform } from '@angular/core';
import { orderBy } from 'lodash-es';

@Pipe({
name: 'orderBy',
})
export class OrderByPipe implements PipeTransform {
transform(value?: any[] | null, sortBy?: string | null, order?: 'asc' | 'desc' | null): any[] {
const sortOrder = order ? order : 'asc'; // setting default ascending order

return orderBy(value, [sortBy], [sortOrder]);
}
}
7 changes: 4 additions & 3 deletions udmif/web/src/app/common/pipes/pipes.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { NgModule } from '@angular/core';
import { CapitalizePipe } from './capitalize.pipe';
import { OrderByPipe } from './order-by.pipe';
import { ParsePipe } from './parse.pipe';

@NgModule({
declarations: [CapitalizePipe, ParsePipe],
exports: [CapitalizePipe, ParsePipe],
providers: [CapitalizePipe, ParsePipe],
declarations: [CapitalizePipe, ParsePipe, OrderByPipe],
exports: [CapitalizePipe, ParsePipe, OrderByPipe],
providers: [CapitalizePipe, ParsePipe, OrderByPipe],
})
export class PipesModule {}
5 changes: 0 additions & 5 deletions udmif/web/src/app/device-errors/device-errors.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
.mat-table {
width: 100%;
border: solid thin rgba(0, 0, 0, 0.12);
border-bottom: none;
}
23 changes: 18 additions & 5 deletions udmif/web/src/app/device/device.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

<mat-card class="summary">
<div class="item" *ngFor="let field of fields">
<span class="mat-body-2">{{ field | capitalize }}</span>
<p *ngIf="field === 'lastPayload'; else elseBlock">{{ device?.lastPayload | date: 'MM/dd/yy h:mm a' }}</p>
<ng-template #elseBlock
><p>{{ device?.[field] }}</p></ng-template
>
<span class="mat-body-2">{{ field.label }}</span>
<ng-container [ngSwitch]="field.value">
<ng-container *ngSwitchCase="'lastPayload'">
<p>{{ device?.lastPayload | date: 'MM/dd/yy h:mm a' }}</p>
</ng-container>
<ng-container *ngSwitchCase="'lastSeen'">
<p>{{ device?.lastSeen | date: 'MM/dd/yy h:mm a' }}</p>
</ng-container>
<ng-container *ngSwitchCase="'operational'">
<p>
<ng-container *ngIf="device?.operational === true">Yes</ng-container>
<ng-container *ngIf="device?.operational === false">No</ng-container>
</p>
</ng-container>
<ng-container *ngSwitchDefault>
<p>{{ device?.[field.value] }}</p>
</ng-container>
</ng-container>
</div>
</mat-card>

Expand Down
17 changes: 5 additions & 12 deletions udmif/web/src/app/device/device.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,25 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { NavigationService } from '../navigation/navigation.service';
import { Device, DeviceModel } from './device';
import { Device, DeviceDetail } from './device';
import { DeviceService } from './device.service';
import { DeviceConstants } from './device.constants';

@Component({
templateUrl: './device.component.html',
styleUrls: ['./device.component.scss'],
})
export class DeviceComponent implements OnInit, OnDestroy {
deviceSubscription!: Subscription;
fields: (keyof DeviceModel)[] = [
'make',
'model',
'site',
'section',
'operational',
'serialNumber',
'firmware',
'lastPayload',
];
fields: DeviceDetail[] = this.deviceConstants.deviceDetails;
device?: Device;
loading: boolean = true;

constructor(
private route: ActivatedRoute,
private deviceService: DeviceService,
private navigationService: NavigationService
private navigationService: NavigationService,
private deviceConstants: DeviceConstants
) {}

ngOnInit(): void {
Expand Down
29 changes: 29 additions & 0 deletions udmif/web/src/app/device/device.constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Injectable } from '@angular/core';
import { intersectionBy } from 'lodash-es';
import { DevicesConstants } from '../devices/devices.constants';
import { DeviceDetail, DeviceModel } from './device';

@Injectable({
providedIn: 'root',
})
export class DeviceConstants {
public deviceDetails: DeviceDetail[] = intersectionBy(
this.devicesConstants.deviceColumns,
(<(keyof DeviceModel)[]>[
'make',
'model',
'site',
'section',
'lastPayload',
'operational',
'serialNumber',
'firmware',
'state',
'lastSeen',
'errorsCount',
]).map((value) => ({ value })),
'value'
);

constructor(private devicesConstants: DevicesConstants) {}
}
5 changes: 5 additions & 0 deletions udmif/web/src/app/device/device.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ export type DeviceQueryResponse = {
export type DeviceQueryVariables = {
id: string;
};

export type DeviceDetail = {
value: keyof DeviceModel;
label: string;
};
4 changes: 4 additions & 0 deletions udmif/web/src/app/device/device.gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const GET_DEVICE = gql`
operational
firmware
serialNumber
level
lastSeen
state
errorsCount
validation
}
}
Expand Down
4 changes: 4 additions & 0 deletions udmif/web/src/app/device/device.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ describe('DeviceService', () => {
operational: false,
serialNumber: 's123',
firmware: 'V3',
level: 400,
lastSeen: '2022-01-03',
state: 'CORRECT',
errorsCount: 2,
validation: '',
},
};
Expand Down
1 change: 1 addition & 0 deletions udmif/web/src/app/devices/devices-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const routes: Routes = [
'section',
'lastPayload',
'operational',
'errorsCount',
],
},
},
Expand Down
Loading