From 08408addd3fb27a333e2c376e9290b9049757860 Mon Sep 17 00:00:00 2001 From: Georgy Karataev Date: Tue, 14 Mar 2023 11:25:15 +0100 Subject: [PATCH] feat(ESSNTL-3727): Display group systems (#1790) * Connect group details with inventory table * Remove sorting from the system update method col * Enhance tableProps, implement select none/page * Implement tests for GroupSystems.cy.js * Remove hostIds from fixtures to avoid render table --- .../620f9ae75A8F6b83d78F3B55Af1c4b2C.json | 23 +- cypress/fixtures/hosts.json | 2504 +++++++++++++++++ cypress/support/interceptors.js | 53 + cypress/support/utils.js | 24 + src/api/api.js | 2 +- .../GroupSystems/GroupSystems.cy.js | 321 +++ src/components/GroupSystems/GroupSystems.js | 99 + src/components/GroupSystems/index.js | 29 + src/components/GroupsTable/GroupsTable.cy.js | 18 +- .../GroupDetailSystems.js | 22 - .../InventoryGroupDetail.js | 18 +- src/store/entities.js | 4 +- 12 files changed, 3045 insertions(+), 72 deletions(-) create mode 100644 cypress/fixtures/hosts.json create mode 100644 cypress/support/utils.js create mode 100644 src/components/GroupSystems/GroupSystems.cy.js create mode 100644 src/components/GroupSystems/GroupSystems.js create mode 100644 src/components/GroupSystems/index.js delete mode 100644 src/components/InventoryGroupDetail/GroupDetailSystems.js diff --git a/cypress/fixtures/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C.json b/cypress/fixtures/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C.json index e52cc1577..2f9ce9b03 100644 --- a/cypress/fixtures/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C.json +++ b/cypress/fixtures/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C.json @@ -10,28 +10,7 @@ "account": "irure ea exercitation adipisicing velit", "org_id": "non", "created_at": "1994-07-28T22:00:00.0Z", - "host_ids": [ - "eEfb7FAa-1f0b-Bde3-a4FF-fDdCd5faA764", - "bb7417faE7f9eCdacEDDd0Fcae9Cf4BB", - "2095BB72Aa6E1d2D1DC48bdecF1085eb", - "E645A3Fb42B77c4eBf9faEfCad8f6F5a", - "7fb4fa758Cbc0A861C2Cb21695aeA9d6", - "f6BE4AafA6bF543693Fa3F1fadFaA4E9", - "D608C33f-5e6D-BBEF-Cab5-0FFE8eB1bAc4", - "Dd4De9b6-7f3a-ED3d-2a84-D60e4Af2Cd9d", - "ae08E8dd-FFdB-cBC1-BA2A-d0aaC61C1B55", - "dcaD88bD4CeaaDC8bceD5d730ffba4cF", - "5a9F9CDAE74F3116a9c848Eeb1C65EA0", - "f53eDCBe3Fb957BE5dBec9322f030F94", - "c6fbBE38-30D7-D7e9-C8C7-72F4a61Bea9c", - "20E5EedA1e3f2aC2dCaADDCa4BFEED5B", - "adEcDf6ac4A999ccecdbCe7E9e01e23C", - "Bf0E2e8C-7e96-f0C8-9fea-1bD5fa9E18ce", - "6349ADdf-8d6B-bF1e-F5AE-13f0B7ca4acE", - "DBD5E149-C967-12b3-Cc6B-6c9220bA32e1", - "4EC19BbD-b556-ED9E-33E7-Eb5Be40AaeDe", - "CE05B39b3FdDad8dDE2b5DebB7CABe7D" - ] + "host_ids": [] } ], "total": 1 diff --git a/cypress/fixtures/hosts.json b/cypress/fixtures/hosts.json new file mode 100644 index 000000000..3b156ab11 --- /dev/null +++ b/cypress/fixtures/hosts.json @@ -0,0 +1,2504 @@ +{ + "count": 19, + "page": 1, + "per_page": 50, + "results": [ + { + "org_id": "velit dolore cillum ut veniam", + "ip_addresses": [ + "nulla eni", + "adipisicing Duis", + "commodo", + "c", + "ad ", + "dolore dolor", + "laboris eiusmod aliqua labore", + "veniam dolore dolor", + "amet dolore", + "sint", + "anim", + "irure", + "in", + "et lab", + "sed veniam", + "ut Excepteur", + "nisi occaecat sint amet", + "officia laborum dolor", + "commodo", + "anim dolor ullamco qui deserunt" + ], + "mac_addresses": null, + "facts": [ + { + "namespace": "et ali" + }, + { + "namespace": "aliqua ipsum laboris" + }, + { + "namespace": "dolore magna quis ipsum" + }, + { + "namespace": "eu proident aliqua et officia" + }, + { + "namespace": "sed labore tempor dolor" + }, + { + "namespace": "labore occaecat dol" + }, + { + "namespace": "sunt qui volupta" + }, + { + "namespace": "cupidatat Duis et velit dolor" + }, + { + "namespace": "voluptate occaecat" + }, + { + "namespace": "cillum adipisi" + }, + { + "namespace": "commodo" + }, + { + "namespace": "amet dolor aute" + }, + { + "namespace": "ex dese" + }, + { + "namespace": "consectetur mollit culpa dolore do" + }, + { + "namespace": "commodo ipsum cupidatat est anim" + }, + { + "namespace": "consectetur aliquip dolore cillum" + }, + { + "namespace": "consectetur ut nulla" + }, + { + "namespace": "volu" + }, + { + "namespace": "mollit" + }, + { + "namespace": "deserunt sit adipisicing in dolore" + } + ], + "reporter": "dolor in dolor officia", + "per_reporter_staleness": { + "aliquip__": { + "check_in_succeeded": false, + "last_check_in": "1987-10-30T00:00:00.0Z", + "stale_timestamp": "1977-07-20T23:00:00.0Z" + } + }, + "fqdn": null, + "updated": "1987-02-23T23:00:00.0Z", + "bios_uuid": null, + "subscription_manager_id": "dolor", + "provider_type": null, + "stale_timestamp": null, + "satellite_id": null, + "id": "dolor", + "stale_warning_timestamp": null, + "account": "Ut labore reprehenderit velit est", + "ansible_host": null, + "insights_id": "commodo nulla", + "provider_id": null, + "display_name": null, + "created": "2006-03-24T23:00:00.0Z", + "culled_timestamp": null + }, + { + "org_id": "consectetur elit", + "stale_timestamp": "2013-06-07T22:00:00.0Z", + "facts": [ + { + "namespace": "adipisicing" + }, + { + "namespace": "occaecat sunt" + }, + { + "namespace": "Ut labore est velit enim" + }, + { + "namespace": "cupidatat aliqua tempor amet" + }, + { + "namespace": "consequat enim Ut" + }, + { + "namespace": "incididunt" + }, + { + "namespace": "nulla do" + }, + { + "namespace": "proident tempor enim ut quis" + }, + { + "namespace": "laborum" + }, + { + "namespace": "aliqua deserunt" + }, + { + "namespace": "velit" + }, + { + "namespace": "et incididunt laboris non anim" + }, + { + "namespace": "do" + }, + { + "namespace": "est et ea " + }, + { + "namespace": "in" + }, + { + "namespace": "minim" + }, + { + "namespace": "fugiat Excepteur" + }, + { + "namespace": "dolore mollit qui" + }, + { + "namespace": "ad" + }, + { + "namespace": "ut sint" + } + ], + "ip_addresses": [ + "ullamco", + "culpa officia eiusmod voluptate quis", + "commodo non Excepteur dolore", + "consequat", + "cillum labor", + "nostrud amet deserunt dolor", + "reprehenderit", + "ea in nisi", + "in", + "fugiat adipisicing", + "sit est in qui", + "ea i", + "exercitation adipisic", + "sunt exercitation", + "fugiat sunt est dolore sint", + "eiusmod nulla aute", + "do deserunt", + "commodo nostrud cupidatat Excepteur id", + "non irure cillum minim", + "tempor nulla culpa non sunt" + ], + "display_name": null, + "updated": "1966-08-09T23:00:00.0Z", + "per_reporter_staleness": { + "eiusmodc2": { + "last_check_in": "1943-10-27T00:00:00.0Z", + "check_in_succeeded": true, + "stale_timestamp": "2012-12-31T23:00:00.0Z" + }, + "do_39f": { + "last_check_in": "1950-02-01T23:00:00.0Z", + "stale_timestamp": "1970-04-16T23:00:00.0Z", + "check_in_succeeded": false + }, + "labore7": { + "check_in_succeeded": true, + "last_check_in": "1981-06-13T22:00:00.0Z", + "stale_timestamp": "1945-09-29T22:00:00.0Z" + } + }, + "provider_type": null, + "stale_warning_timestamp": "2007-11-12T00:00:00.0Z", + "insights_id": null, + "reporter": null, + "satellite_id": "consequat occaecat Ut", + "subscription_manager_id": "magna ullamco in Ut", + "account": "dolore voluptate", + "mac_addresses": [ + "cupidatat nisi officia magna do", + "commodo ad", + "sint est id", + "irure eiusmod", + "ea magna aute occaecat dolor", + "aute voluptate", + "esse", + "nisi et", + "et aute qui nostrud in", + "dolore ut", + "ut veniam", + "mollit in eu aliqua", + "mollit in ut Lorem", + "amet", + "Duis qui sit adipisicing sunt", + "dolor", + "do sed", + "adipisicing in cupidatat", + "anim in consectetur sit", + "enim minim ex labore" + ], + "ansible_host": null, + "id": "aute", + "created": "1990-07-14T22:00:00.0Z", + "fqdn": null, + "provider_id": null, + "bios_uuid": "anim nulla ex eiusmod voluptate", + "culled_timestamp": null + }, + { + "org_id": "deserunt sit irure", + "updated": "1953-10-25T00:00:00.0Z", + "ip_addresses": [ + "exercitation id qui Lorem", + "ad Ut", + "incididunt aliquip Ut", + "voluptate nost", + "la", + "Duis consectetur do enim occaecat", + "laborum aliquip velit", + "mollit culpa", + "magna ex incididunt eu sed", + "adipisicing officia", + "magna proident pariatur ullamco", + "fugiat officia ullamco", + "Duis", + "ea ex quis id", + "eiusmod ex aliquip mollit pari", + "dolor ipsum laboris", + "sunt aliqua magna", + "dolor anim", + "in reprehenderit ut aute", + "" + ], + "id": "anim commodo", + "display_name": null, + "insights_id": null, + "provider_type": null, + "ansible_host": null, + "subscription_manager_id": "exercitation", + "reporter": "adipisicing veniam velit", + "created": "1962-06-25T23:00:00.0Z", + "account": null, + "mac_addresses": null, + "provider_id": "aute ut sit", + "facts": [ + { + "namespace": "consequat esse dolor" + }, + { + "namespace": "aliquip amet eiusmod ad tempor" + }, + { + "namespace": "fugi" + }, + { + "namespace": "nulla" + }, + { + "namespace": "qui proident et consequat mollit" + }, + { + "namespace": "reprehenderit eiusmod dolor" + }, + { + "namespace": "elit sed" + }, + { + "namespace": "non dolore in elit aute" + }, + { + "namespace": "f" + }, + { + "namespace": "quis" + }, + { + "namespace": "proident mollit enim" + }, + { + "namespace": "aliqua ipsum consectetur laborum ea" + }, + { + "namespace": "incididunt non fugiat eiusmod Ut" + }, + { + "namespace": "officia" + }, + { + "namespace": "laboris quis fugiat sint" + }, + { + "namespace": "labore cupida" + }, + { + "namespace": "quis aliqua d" + }, + { + "namespace": "minim ex" + }, + { + "namespace": "minim non in ut sunt" + }, + { + "namespace": "dolore consectetur do et minim" + } + ], + "stale_warning_timestamp": "1967-03-03T23:00:00.0Z", + "satellite_id": "magna cupidatat occaecat", + "bios_uuid": null, + "stale_timestamp": "1966-06-15T23:00:00.0Z", + "per_reporter_staleness": { + "qui_d0": { + "last_check_in": "1987-01-23T23:00:00.0Z", + "stale_timestamp": "2006-08-07T22:00:00.0Z", + "check_in_succeeded": false + } + }, + "culled_timestamp": null, + "fqdn": null + }, + { + "org_id": "fugiat in quis ea", + "stale_warning_timestamp": null, + "satellite_id": null, + "provider_id": null, + "created": "2008-11-15T00:00:00.0Z", + "insights_id": "dolor aliquip labo", + "display_name": "culpa ut Lorem aliquip", + "per_reporter_staleness": { + "nostruda36": { + "stale_timestamp": "2003-05-19T22:00:00.0Z", + "last_check_in": "1999-01-15T23:00:00.0Z", + "check_in_succeeded": false + }, + "ind7": { + "check_in_succeeded": true, + "stale_timestamp": "2015-04-26T22:00:00.0Z", + "last_check_in": "1966-07-10T23:00:00.0Z" + }, + "magna_73": { + "stale_timestamp": "2002-10-22T00:00:00.0Z", + "last_check_in": "2008-06-19T22:00:00.0Z", + "check_in_succeeded": true + } + }, + "reporter": null, + "updated": "1974-10-05T23:00:00.0Z", + "provider_type": "tempor cupidatat deserunt fugiat", + "bios_uuid": "qui nostrud aliqua consectetur", + "ip_addresses": [ + "reprehenderit Excepteur aliqua incididunt", + "dolor dolore ullamco fugiat", + "fugiat", + "eu sed ut Ut anim", + "occaecat", + "incididunt officia eu labore pro", + "esse tempor quis mollit cillum", + "exercitation dolore nostrud anim labo", + "elit cillum", + "incididunt sit qui", + "dolor", + "ut enim nulla ", + "aliquip id fugiat", + "ullamco id ut in", + "labore est laboris id do", + "proident sit Lorem", + "mollit", + "ipsum", + "quis", + "cillum esse" + ], + "ansible_host": "", + "stale_timestamp": null, + "subscription_manager_id": "ea sunt", + "facts": [ + { + "namespace": "Lorem enim" + }, + { + "namespace": "ipsum velit est enim dolore" + }, + { + "namespace": "Duis ea" + }, + { + "namespace": "elit ipsum" + }, + { + "namespace": "Duis dolore in" + }, + { + "namespace": "aliquip" + }, + { + "namespace": "consequat Lorem occaecat" + }, + { + "namespace": "cillum" + }, + { + "namespace": "Ut ad" + }, + { + "namespace": "nisi" + }, + { + "namespace": "eiusmod ea do ad adipisicing" + }, + { + "namespace": "in id incididunt" + }, + { + "namespace": "aliqua" + }, + { + "namespace": "Lorem fugiat" + }, + { + "namespace": "dolore laboris" + }, + { + "namespace": "ipsum" + }, + { + "namespace": "id sint culpa ea" + }, + { + "namespace": "in labore ullamco" + }, + { + "namespace": "nostrud dolore aliquip dolor" + }, + { + "namespace": "irure" + } + ], + "account": "commodo velit ad do", + "culled_timestamp": null, + "mac_addresses": [ + "commodo", + "minim", + "Duis eiusmod ut", + "pariatur", + "consequat mollit aliquip ullamco dolore", + "eu Ut Lorem ut fugiat", + "nisi ullamco", + "anim voluptate", + "Duis", + "aute", + "ali", + "magna", + "nostrud", + "consequat dolore do sint", + "anim in dolor pariatur incididunt", + "ex Lorem sed in", + "qui Duis cupidatat nisi exercitation", + "velit elit nostrud", + "qui Excepteur fugiat reprehe", + "nu" + ], + "fqdn": null, + "id": "ea qui dolor voluptate" + }, + { + "org_id": "ut do pariatur consequat", + "updated": "1945-11-22T00:00:00.0Z", + "per_reporter_staleness": { + "culpae": { + "check_in_succeeded": false, + "stale_timestamp": "1948-10-13T00:00:00.0Z", + "last_check_in": "1961-04-09T23:00:00.0Z" + }, + "et_5e3": { + "stale_timestamp": "1979-04-12T22:00:00.0Z", + "last_check_in": "1944-09-23T22:00:00.0Z", + "check_in_succeeded": false + }, + "eiusmod_8": { + "check_in_succeeded": true, + "stale_timestamp": "2008-09-21T22:00:00.0Z", + "last_check_in": "2009-05-16T22:00:00.0Z" + }, + "eube": { + "stale_timestamp": "2016-03-19T23:00:00.0Z", + "last_check_in": "1985-10-19T00:00:00.0Z", + "check_in_succeeded": true + }, + "Duis3c": { + "stale_timestamp": "1971-06-27T23:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "1987-08-17T22:00:00.0Z" + } + }, + "stale_timestamp": "1995-03-17T23:00:00.0Z", + "facts": [ + { + "namespace": "Excepteur in quis" + }, + { + "namespace": "enim quis" + }, + { + "namespace": "Lorem sit" + }, + { + "namespace": "reprehenderit ea nulla anim incididunt" + }, + { + "namespace": "veniam ut tempor anim laboris" + }, + { + "namespace": "quis deserunt" + }, + { + "namespace": "ex Lorem ut adipisicing" + }, + { + "namespace": "aute elit" + }, + { + "namespace": "sed culpa" + }, + { + "namespace": "ad mollit non nisi occaecat" + }, + { + "namespace": "amet ut do" + }, + { + "namespace": "esse sed" + }, + { + "namespace": "laboris" + }, + { + "namespace": "sit" + }, + { + "namespace": "volupta" + }, + { + "namespace": "sunt ipsum cupidatat commodo" + }, + { + "namespace": "enim aliquip cillum" + }, + { + "namespace": "ad Duis" + }, + { + "namespace": "consectetur aute veniam esse" + }, + { + "namespace": "cillum commodo consequat fugiat in" + } + ], + "satellite_id": "adipisicing fugiat irur", + "provider_id": "tempor", + "culled_timestamp": "2008-09-27T22:00:00.0Z", + "created": "1955-09-28T23:00:00.0Z", + "fqdn": null, + "display_name": "in consec", + "insights_id": null, + "mac_addresses": [ + "do", + "nisi pariatu", + "dolore magna", + "in", + "eiusm", + "aliquip ut nisi", + "proident", + "occaecat ", + "tempor", + "consec", + "ad incididunt aute", + "quis anim", + "consectetur cupidatat", + "ad do", + "sed", + "nulla cillum Duis sed", + "dolor ea Ut", + "", + "incididunt nulla sed officia consectet", + "in amet aliquip Excepteur magna" + ], + "account": null, + "reporter": "sit amet Ut", + "subscription_manager_id": "officia", + "provider_type": "veniam ipsum commodo in", + "ansible_host": null, + "id": "consectetur", + "stale_warning_timestamp": "1988-07-25T22:00:00.0Z", + "bios_uuid": null, + "ip_addresses": [ + "ipsum ", + "minim reprehenderit ad et", + "est laborum", + "Ut in", + "esse culpa", + "laboris non", + "sunt amet dolor cillum", + "nostrud eiusmod", + "veniam non dolor aliqua", + "et consequat", + "aliqua nulla consequat", + "esse eiusmod est", + "non sed incididunt sunt aliquip", + "id commodo", + "nisi qui deserunt", + "Lorem sit qui dolor", + "ullamco", + "Duis dolore dolore temp", + "enim ut in ipsum Excepteur", + "ut dolor consequat aliquip ea" + ] + }, + { + "org_id": "irure magna est ipsum commodo", + "account": null, + "per_reporter_staleness": { + "tempor4f": { + "check_in_succeeded": true, + "last_check_in": "1983-06-05T22:00:00.0Z", + "stale_timestamp": "1949-05-04T22:00:00.0Z" + }, + "nisi260": { + "stale_timestamp": "2011-06-10T22:00:00.0Z", + "last_check_in": "1977-09-11T23:00:00.0Z", + "check_in_succeeded": false + } + }, + "updated": "1997-10-13T00:00:00.0Z", + "bios_uuid": null, + "facts": [ + { + "namespace": "dolore culpa ullamco" + }, + { + "namespace": "commodo est eu nulla ut" + }, + { + "namespace": "sed exercitation in" + }, + { + "namespace": "labore qui fugiat sunt" + }, + { + "namespace": "id aliquip" + }, + { + "namespace": "deserunt" + }, + { + "namespace": "culpa enim" + }, + { + "namespace": "commodo" + }, + { + "namespace": "irure incididunt nostrud proident" + }, + { + "namespace": "ullamco s" + }, + { + "namespace": "mollit incididunt aliquip Lorem" + }, + { + "namespace": "et" + }, + { + "namespace": "ut do ir" + }, + { + "namespace": "culpa adipisicing" + }, + { + "namespace": "consectetur ad magna sit enim" + }, + { + "namespace": "cupidatat" + }, + { + "namespace": "d" + }, + { + "namespace": "sed dolor ad labore veniam" + }, + { + "namespace": "ut" + }, + { + "namespace": "Ut" + } + ], + "id": "quis enim et", + "culled_timestamp": null, + "fqdn": "cupidatat nisi ut", + "stale_warning_timestamp": null, + "reporter": "dolor ex ullamco", + "mac_addresses": [ + "cupidatat", + "exercitation ut sed officia", + "reprehenderit do", + "incididunt tempor Ut consequat exerci", + "dolor eu", + "do aliqua", + "ipsum in", + "culpa dolore", + "et amet nostrud elit", + "velit dolore anim", + "officia ipsum", + "adipisicing veniam nostrud", + "Excepteur", + "pariatur voluptate Lorem", + "esse aliquip", + "aute officia eiusmod Duis", + "elit ut minim consequat", + "cillum ad mollit", + "tempor et cillum aute in", + "eu nisi" + ], + "provider_type": "laboris id labore occaecat aliq", + "subscription_manager_id": "proident ut nulla minim fugiat", + "ip_addresses": null, + "satellite_id": "reprehenderit incididunt ea dolor", + "display_name": null, + "stale_timestamp": null, + "ansible_host": null, + "created": "2016-06-02T22:00:00.0Z", + "insights_id": null, + "provider_id": "ipsum Ut id tempor cupid" + }, + { + "org_id": "t", + "facts": [ + { + "namespace": "in in sed" + }, + { + "namespace": "nisi incididunt ullamco quis" + }, + { + "namespace": "elit tempor sunt" + }, + { + "namespace": "elit" + }, + { + "namespace": "deserunt proident no" + }, + { + "namespace": "laboris nostrud" + }, + { + "namespace": "Lorem" + }, + { + "namespace": "proident officia laboris" + }, + { + "namespace": "sit Lorem" + }, + { + "namespace": "amet velit" + }, + { + "namespace": "mollit Duis" + }, + { + "namespace": "magna Lorem eiusmod mo" + }, + { + "namespace": "o" + }, + { + "namespace": "esse dolor" + }, + { + "namespace": "ad enim" + }, + { + "namespace": "dolore adipisicing Duis" + }, + { + "namespace": "minim nulla est ea" + }, + { + "namespace": "est elit" + }, + { + "namespace": "et" + }, + { + "namespace": "dolore adipisicin" + } + ], + "bios_uuid": "ea ipsum eu voluptate", + "stale_timestamp": "2008-01-15T23:00:00.0Z", + "insights_id": "aliquip labore", + "mac_addresses": null, + "display_name": "ven", + "created": "1995-09-16T22:00:00.0Z", + "per_reporter_staleness": { + "ea9e": { + "last_check_in": "1999-10-20T00:00:00.0Z", + "check_in_succeeded": false, + "stale_timestamp": "1955-07-02T23:00:00.0Z" + }, + "et_4f": { + "last_check_in": "1952-04-02T23:00:00.0Z", + "stale_timestamp": "1973-06-27T23:00:00.0Z", + "check_in_succeeded": true + } + }, + "fqdn": null, + "stale_warning_timestamp": null, + "ansible_host": "non minim sint et", + "subscription_manager_id": null, + "provider_id": "aute tempor", + "ip_addresses": [ + "ut sunt", + "nisi", + "proident exercitation labore elit consequat", + "mollit", + "incididunt qui", + "eiusmod veniam qui magna ut", + "in irure", + "dolore proident reprehenderit", + "ipsu", + "veniam adipisicing officia", + "dolor et dolore", + "enim dolor", + "exercitation laborum id deserunt", + "quis sed nostrud volu", + "amet nulla", + "ex", + "minim amet", + "esse est voluptate", + "labore velit", + "cupidatat" + ], + "reporter": null, + "satellite_id": null, + "account": "aliquip", + "provider_type": "in", + "id": "in", + "updated": "2004-12-06T23:00:00.0Z", + "culled_timestamp": null + }, + { + "org_id": "sit sint", + "provider_id": "est ad do", + "provider_type": "in", + "created": "1956-01-15T23:00:00.0Z", + "ip_addresses": null, + "culled_timestamp": "1977-08-01T23:00:00.0Z", + "satellite_id": null, + "updated": "1971-03-27T23:00:00.0Z", + "stale_timestamp": "2017-05-15T22:00:00.0Z", + "bios_uuid": "Excepteur non", + "subscription_manager_id": null, + "reporter": null, + "account": null, + "id": "adipisicing Ut non ut", + "fqdn": "Lorem ex est a", + "stale_warning_timestamp": null, + "ansible_host": null, + "per_reporter_staleness": { + "tempor5d1": { + "stale_timestamp": "1985-04-23T22:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "2003-04-02T22:00:00.0Z" + }, + "quis_cc": { + "check_in_succeeded": false, + "stale_timestamp": "2013-07-13T22:00:00.0Z", + "last_check_in": "1958-06-16T23:00:00.0Z" + } + }, + "facts": [ + { + "namespace": "nisi" + }, + { + "namespace": "non" + }, + { + "namespace": "et dolore" + }, + { + "namespace": "est laboris sed exercitation Excepteur" + }, + { + "namespace": "dolor" + }, + { + "namespace": "cupidatat dolore" + }, + { + "namespace": "do in aliqua cupidata" + }, + { + "namespace": "ullamco" + }, + { + "namespace": "cupidatat" + }, + { + "namespace": "enim labore" + }, + { + "namespace": "et" + }, + { + "namespace": "i" + }, + { + "namespace": "sint id cillum adipisicing" + }, + { + "namespace": "ut" + }, + { + "namespace": "e" + }, + { + "namespace": "quis" + }, + { + "namespace": "qui" + }, + { + "namespace": "Lorem magna sit tem" + }, + { + "namespace": "laboris aute ad minim" + }, + { + "namespace": "commodo do deserunt nostrud" + } + ], + "display_name": null, + "mac_addresses": null, + "insights_id": "in id fugiat dolor quis" + }, + { + "org_id": "est sunt nulla voluptate r", + "ip_addresses": [ + "nostrud occaecat dolor", + "dolore", + "ipsum vel", + "velit culpa commodo", + "aliqua", + "cillum ", + "tempor est do eiusmod elit", + "laboris incididunt dolor dolore laborum", + "velit elit commodo", + "aliquip sint sunt mollit ea", + "labore pariatur anim", + "dolore aute ut ipsum reprehenderit", + "dolor aute ea", + "dolore et ipsum", + "Lorem eiusmod tempor", + "ex ea", + "dolor pariatur", + "ex Duis", + "pariatur", + "reprehenderit quis cupidatat" + ], + "display_name": "pariatur Duis exercitation occaecat", + "facts": [ + { + "namespace": "cillum fugiat" + }, + { + "namespace": "ea nisi ut aut" + }, + { + "namespace": "quis" + }, + { + "namespace": "non sunt" + }, + { + "namespace": "dol" + }, + { + "namespace": "consequat aliquip esse ex" + }, + { + "namespace": "cupidatat pariatur" + }, + { + "namespace": "id sit cupidatat ut oc" + }, + { + "namespace": "aliqua esse" + }, + { + "namespace": "do" + }, + { + "namespace": "aliqua" + }, + { + "namespace": "ut id" + }, + { + "namespace": "ea labore in sed dolor" + }, + { + "namespace": "dolor labore consectetur quis" + }, + { + "namespace": "Excepteur" + }, + { + "namespace": "labore" + }, + { + "namespace": "in" + }, + { + "namespace": "veniam consectetur magna nisi fug" + }, + { + "namespace": "in sunt magna et aliqua" + }, + { + "namespace": "reprehenderit Ut" + } + ], + "stale_timestamp": null, + "provider_type": "est laboris", + "account": "ut culpa", + "updated": "1962-06-27T23:00:00.0Z", + "mac_addresses": null, + "provider_id": null, + "bios_uuid": null, + "ansible_host": null, + "stale_warning_timestamp": "1992-12-08T23:00:00.0Z", + "created": "2010-03-15T23:00:00.0Z", + "insights_id": null, + "per_reporter_staleness": { + "dolor_fc": { + "stale_timestamp": "1948-05-23T22:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "1969-11-22T00:00:00.0Z" + }, + "cillumd81": { + "last_check_in": "1983-11-26T00:00:00.0Z", + "stale_timestamp": "2002-02-08T23:00:00.0Z", + "check_in_succeeded": true + } + }, + "id": "mollit pariatur elit laborum", + "satellite_id": "ut magna in anim", + "fqdn": null, + "culled_timestamp": "1989-12-30T00:00:00.0Z", + "reporter": "do i", + "subscription_manager_id": null + }, + { + "org_id": "ipsum ", + "account": "do officia aute ut laborum", + "fqdn": "dolore nulla dolor", + "id": "elit magna culpa", + "bios_uuid": null, + "mac_addresses": [ + "quis esse eu sit minim", + "fugiat", + "dolore voluptate", + "Lorem Duis ullamco", + "eu aliqua", + "aliqua dolore", + "ut null", + "Excepteur esse dolore et ullamco", + "in minim", + "dolor", + "exerc", + "officia", + "minim proident velit enim pariatur", + "commodo laborum", + "pariatur", + "sint mollit Excepteur eiusmod officia", + "ullamco aliquip sed", + "dolore et", + "dolore esse", + "dolore Excepteur eiusmod minim" + ], + "ansible_host": null, + "reporter": "aliqua proident amet quis sin", + "satellite_id": null, + "stale_timestamp": null, + "created": "2013-09-10T22:00:00.0Z", + "updated": "1976-07-14T23:00:00.0Z", + "display_name": null, + "ip_addresses": null, + "insights_id": null, + "facts": [ + { + "namespace": "id" + }, + { + "namespace": "cupidatat non l" + }, + { + "namespace": "dolore" + }, + { + "namespace": "Lor" + }, + { + "namespace": "labore nisi" + }, + { + "namespace": "ullamco in dese" + }, + { + "namespace": "dolor fugiat laborum aliquip qui" + }, + { + "namespace": "cillum non" + }, + { + "namespace": "molli" + }, + { + "namespace": "Ut" + }, + { + "namespace": "Duis dolore incididunt est dolor" + }, + { + "namespace": "officia ut id pr" + }, + { + "namespace": "enim reprehenderit c" + }, + { + "namespace": "sed esse commodo" + }, + { + "namespace": "fugiat sit" + }, + { + "namespace": "cupidatat pariatur nisi Excepteur" + }, + { + "namespace": "consequat ipsum nostrud voluptate dolore" + }, + { + "namespace": "laboris sed" + }, + { + "namespace": "incididunt mollit amet" + }, + { + "namespace": "ut labore et proident" + } + ], + "culled_timestamp": "1955-12-25T00:00:00.0Z", + "stale_warning_timestamp": null, + "per_reporter_staleness": { + "Excepteur_a90": { + "check_in_succeeded": true, + "last_check_in": "1952-03-05T23:00:00.0Z", + "stale_timestamp": "2013-07-04T22:00:00.0Z" + } + }, + "subscription_manager_id": "in ea ut tempor", + "provider_type": "Ut incididunt sit officia mollit", + "provider_id": null + }, + { + "org_id": "aliqua labore velit veniam dolore", + "stale_warning_timestamp": null, + "mac_addresses": null, + "per_reporter_staleness": { + "labore_84": { + "stale_timestamp": "1952-07-20T23:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "2006-09-08T22:00:00.0Z" + }, + "voluptate_1": { + "stale_timestamp": "1990-08-20T22:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "1957-05-01T23:00:00.0Z" + } + }, + "display_name": "sit dolor eiusmod", + "satellite_id": null, + "ansible_host": null, + "updated": "1980-04-01T23:00:00.0Z", + "insights_id": null, + "subscription_manager_id": null, + "id": "aute", + "facts": [ + { + "namespace": "in" + }, + { + "namespace": "sed mollit nisi ad" + }, + { + "namespace": "in cillum non" + }, + { + "namespace": "mollit aliquip nisi cillum" + }, + { + "namespace": "laboris amet cupidatat ut" + }, + { + "namespace": "adipisicing est" + }, + { + "namespace": "magna cillum" + }, + { + "namespace": "fugiat in" + }, + { + "namespace": "in incididunt Duis minim" + }, + { + "namespace": "dolore in elit " + }, + { + "namespace": "in eu elit" + }, + { + "namespace": "dolore do est" + }, + { + "namespace": "ut cillum deserunt minim dolore" + }, + { + "namespace": "commodo " + }, + { + "namespace": "adipisi" + }, + { + "namespace": "quis ex pariatur" + }, + { + "namespace": "culpa consequat Ut consectetur" + }, + { + "namespace": "exercitation est ad" + }, + { + "namespace": "anim adipisicing occaecat reprehenderit veniam" + }, + { + "namespace": "labore cupidatat Duis" + } + ], + "account": "Duis Excepteur sint magna", + "ip_addresses": [ + "sunt adipisicin", + "sunt Duis irure", + "aliquip enim et ut ali", + "proident aliquip", + "aliquip laborum adipisicing", + "fugiat anim qui", + "ut proident", + "tempor dolore", + "cillum", + "quis", + "incididunt dolore in deserun", + "reprehenderit esse Ut", + "Ut mollit dolor", + "veniam fugiat laborum minim ips", + "officia veniam in reprehenderit ipsum", + "Excepteur cupidatat Lorem ea", + "Ut mollit fugiat culpa", + "commodo qui velit", + "adipisicing est in ut sit", + "fugiat labore nulla est laboris" + ], + "provider_type": null, + "bios_uuid": null, + "reporter": "ad Excep", + "fqdn": "officia non ", + "culled_timestamp": "1971-03-30T23:00:00.0Z", + "provider_id": "off", + "created": "2008-08-15T22:00:00.0Z", + "stale_timestamp": "2001-07-05T22:00:00.0Z" + }, + { + "org_id": "irure anim labore ut", + "account": "aliqua adipisicing", + "id": "voluptate velit", + "culled_timestamp": null, + "subscription_manager_id": null, + "ansible_host": "conse", + "stale_warning_timestamp": "1987-03-16T23:00:00.0Z", + "updated": "1977-06-12T23:00:00.0Z", + "reporter": null, + "insights_id": "dolore voluptate in Ut", + "bios_uuid": "in occaecat", + "per_reporter_staleness": { + "ullamco1": { + "last_check_in": "1964-07-29T23:00:00.0Z", + "stale_timestamp": "1997-05-19T22:00:00.0Z", + "check_in_succeeded": true + }, + "qui_c48": { + "last_check_in": "1976-03-01T23:00:00.0Z", + "check_in_succeeded": false, + "stale_timestamp": "2009-11-25T00:00:00.0Z" + } + }, + "provider_id": "in", + "stale_timestamp": "1985-10-31T00:00:00.0Z", + "display_name": null, + "created": "2000-02-21T23:00:00.0Z", + "fqdn": "ex quis cupida", + "facts": [ + { + "namespace": "non" + }, + { + "namespace": "aute" + }, + { + "namespace": "amet Excepteur" + }, + { + "namespace": "culpa ex" + }, + { + "namespace": "eiusmod pr" + }, + { + "namespace": "sit ad" + }, + { + "namespace": "mollit pariatur veniam dolore" + }, + { + "namespace": "nulla id" + }, + { + "namespace": "sit dolor sunt non" + }, + { + "namespace": "ipsum occaecat" + }, + { + "namespace": "minim" + }, + { + "namespace": "labore quis" + }, + { + "namespace": "Ut cupidatat commodo est" + }, + { + "namespace": "est ad" + }, + { + "namespace": "nulla" + }, + { + "namespace": "sunt veniam exercit" + }, + { + "namespace": "ex laborum dolor do" + }, + { + "namespace": "cupidatat eiusmod nisi" + }, + { + "namespace": "cillum quis qui irure ipsum" + }, + { + "namespace": "eu" + } + ], + "satellite_id": "minim ad Duis tempor cillum", + "mac_addresses": [ + "nisi eiusmod", + "eiusmod non", + "minim anim nostr", + "culpa Ut", + "ad eu commodo laborum sed", + "eu labore officia", + "ex sunt aliquip quis", + "consequat irure esse minim", + "culpa in Ut deserunt", + "commodo aliquip", + "cillum incididunt dolor cupidatat sit", + "ut", + "cillum dolore", + "enim nostr", + "nostrud commodo", + "labore dolore", + "in", + "exercitation aliqua", + "aliqua", + "consectetur" + ], + "ip_addresses": [ + "ipsum sunt", + "esse eiusmod dolore tempor", + "consequat", + "amet est", + "cupidatat", + "do aute", + "aliquip consectetur sunt", + "et", + "eiusmod", + "non laborum cillum nostrud in", + "est cupidatat elit dolor", + "nostrud", + "qui ea laborum enim", + "amet id proident culpa reprehenderit", + "fugiat Lorem deserunt do", + "consequat Duis aliqua in", + "labor", + "volupta", + "aliquip pariatur voluptate o", + "veniam ut dolore" + ], + "provider_type": null + }, + { + "org_id": "nostrud ullamco sed dolor", + "provider_id": "officia do", + "satellite_id": null, + "ip_addresses": [ + "officia commodo ipsum laboris", + "mollit ex veniam dolor", + "ipsu", + "pariatur ut", + "velit Lorem laborum non", + "nisi labore", + "nulla cupidatat aute", + "aute", + "reprehenderit", + "eu amet", + "magna nulla ea ad", + "dolore", + "magna exercitation", + "aliqua", + "sed dolor adipisicing", + "culpa quis non", + "ad esse", + "ad ex occaecat minim anim", + "eu in cupidatat consectetur irure", + "occaecat eiusmo" + ], + "insights_id": "exercitation et in nostrud", + "ansible_host": null, + "facts": [ + { + "namespace": "cupidatat in aliquip pariatur sed" + }, + { + "namespace": "quis ea culpa aute" + }, + { + "namespace": "do" + }, + { + "namespace": "ad dolor reprehenderit et dolore" + }, + { + "namespace": "enim" + }, + { + "namespace": "magna adipisicing ex aute qui" + }, + { + "namespace": "sunt pa" + }, + { + "namespace": "laboris" + }, + { + "namespace": "dolor elit cupidatat" + }, + { + "namespace": "et" + }, + { + "namespace": "et amet" + }, + { + "namespace": "elit ea" + }, + { + "namespace": "in proident" + }, + { + "namespace": "deserunt do mollit esse" + }, + { + "namespace": "volupta" + }, + { + "namespace": "in minim Ut sed" + }, + { + "namespace": "aute incididu" + }, + { + "namespace": "cupidatat" + }, + { + "namespace": "proident elit" + }, + { + "namespace": "dolore reprehenderit sint" + } + ], + "fqdn": "ad", + "bios_uuid": null, + "per_reporter_staleness": { + "tempor_18": { + "check_in_succeeded": true, + "stale_timestamp": "2016-10-13T00:00:00.0Z", + "last_check_in": "1957-02-05T23:00:00.0Z" + }, + "eiusmod_2": { + "stale_timestamp": "1965-12-23T00:00:00.0Z", + "last_check_in": "1955-12-13T00:00:00.0Z", + "check_in_succeeded": true + }, + "deserunt_fd": { + "check_in_succeeded": false, + "last_check_in": "1946-08-20T22:00:00.0Z", + "stale_timestamp": "1993-01-13T23:00:00.0Z" + } + }, + "account": null, + "created": "1962-09-26T23:00:00.0Z", + "reporter": null, + "provider_type": null, + "updated": "1971-07-15T23:00:00.0Z", + "stale_timestamp": "1998-01-11T23:00:00.0Z", + "id": "elit laboris velit ullamco non", + "mac_addresses": [ + "qui", + "tempor irure", + "incid", + "mollit voluptate", + "sint aliqua", + "proident", + "i", + "laborum ut cillum in", + "do qui", + "incididunt aute", + "in", + "commodo Lor", + "dolore aliqua laboris", + "tempor dolor do ut eu", + "magna officia in enim ut", + "non culpa", + "quis anim fugiat", + "nisi pariatur culpa consectetur", + "id sunt elit Duis", + "Ut eu" + ], + "culled_timestamp": "2008-02-13T23:00:00.0Z", + "stale_warning_timestamp": null, + "subscription_manager_id": null, + "display_name": "nostrud dolor cillum elit velit" + }, + { + "org_id": "amet cillum laboris velit enim", + "created": "1975-10-10T00:00:00.0Z", + "fqdn": "officia id", + "id": "dolore aut", + "bios_uuid": null, + "stale_warning_timestamp": "2011-11-15T00:00:00.0Z", + "provider_id": "in aliqua ut Lorem", + "per_reporter_staleness": { + "dolore_8": { + "stale_timestamp": "2000-07-18T22:00:00.0Z", + "check_in_succeeded": true, + "last_check_in": "1971-05-12T23:00:00.0Z" + }, + "eiusmod8": { + "last_check_in": "2009-10-10T00:00:00.0Z", + "stale_timestamp": "1955-05-29T23:00:00.0Z", + "check_in_succeeded": false + }, + "Loremddf": { + "stale_timestamp": "1948-01-23T23:00:00.0Z", + "last_check_in": "1950-08-29T23:00:00.0Z", + "check_in_succeeded": true + } + }, + "provider_type": null, + "display_name": null, + "mac_addresses": [ + "ex", + "dolor dolor", + "reprehenderit pariatur", + "aliqua sed Excepteur sit Lorem", + "est consequat", + "minim ", + "anim", + "commodo esse sint adipisicing", + "et culpa enim sint dolor", + "deserunt eu", + "ullamco sit", + "nostrud", + "Ut culpa est", + "sint magna", + "Excepteur nulla consectetur", + "Excepteur occaecat est", + "Lorem ex fugiat", + "ex exercitation voluptate", + "cillum", + "Ut amet ex deserunt" + ], + "account": null, + "ansible_host": "sed do consequa", + "satellite_id": "dolore", + "insights_id": null, + "reporter": "eiusmod mollit sit proi", + "ip_addresses": null, + "stale_timestamp": null, + "culled_timestamp": "1944-11-17T00:00:00.0Z", + "updated": "1955-12-02T23:00:00.0Z", + "facts": [ + { + "namespace": "dolor commodo nulla" + }, + { + "namespace": "sunt in ad ipsum" + }, + { + "namespace": "sit nostrud tempor non" + }, + { + "namespace": "eu laboris co" + }, + { + "namespace": "consequat sint laboris officia nulla" + }, + { + "namespace": "qui tempor enim" + }, + { + "namespace": "qui eu dolore consectetur" + }, + { + "namespace": "proident exercitation id in" + }, + { + "namespace": "fugiat sunt nostrud id" + }, + { + "namespace": "ea consequat" + }, + { + "namespace": "laborum sunt quis" + }, + { + "namespace": "irure fugiat id mollit tempor" + }, + { + "namespace": "id anim" + }, + { + "namespace": "sunt aliq" + }, + { + "namespace": "ex esse in" + }, + { + "namespace": "anim non est Duis" + }, + { + "namespace": "magna pariatur laboris nisi" + }, + { + "namespace": "exercitation labore dolor pariatur voluptate" + }, + { + "namespace": "Excepteu" + }, + { + "namespace": "cillum" + } + ], + "subscription_manager_id": null + }, + { + "org_id": "ex commodo ", + "provider_type": "ad qui Duis ", + "mac_addresses": [ + "in es", + "esse dolor", + "dolore et", + "cillum sit", + "occaecat", + "pariatur irure", + "proident consectetur culpa irure", + "in elit fugiat ut", + "tempor laborum est voluptate", + "dolore dolor n", + "dolor fugiat aute mollit", + "nulla ut ad sed sunt", + "do officia", + "anim", + "sed adipisicing", + "adipisicing amet sit aliqua", + "laboris anim nostrud do", + "laborum exercitation", + "o", + "commodo fugiat" + ], + "stale_warning_timestamp": null, + "insights_id": "cupidatat ut", + "culled_timestamp": null, + "display_name": null, + "updated": "2002-09-04T22:00:00.0Z", + "bios_uuid": null, + "ip_addresses": [ + "velit", + "aute consectetur voluptate adipisicing", + "aliqua", + "consequat magna et commodo exercitation", + "deserunt fugiat esse", + "sit mollit est", + "veniam est", + "culpa occaecat id", + "deserunt enim", + "adipisicing", + "est exercitation ullamco", + "officia culpa aliqua", + "fugiat anim eu voluptate Ut", + "in dolor reprehenderit Duis enim", + "pariatur", + "Duis sed cillum tempor in", + "do", + "d", + "id laborum commodo", + "velit" + ], + "satellite_id": "pariatur consequat Lorem enim officia", + "provider_id": "mollit", + "facts": [ + { + "namespace": "deserunt ipsum " + }, + { + "namespace": "aliqua est" + }, + { + "namespace": "proident" + }, + { + "namespace": "magna irure consectetur" + }, + { + "namespace": "consectetur non commodo ut" + }, + { + "namespace": "in qui aute magna in" + }, + { + "namespace": "Duis reprehenderit deserunt est" + }, + { + "namespace": "in exercitation nulla" + }, + { + "namespace": "cillum nulla" + }, + { + "namespace": "deserunt elit fugiat est" + }, + { + "namespace": "non" + }, + { + "namespace": "magna" + }, + { + "namespace": "a" + }, + { + "namespace": "eu" + }, + { + "namespace": "magna nostrud incididunt" + }, + { + "namespace": "mollit qui" + }, + { + "namespace": "in tempor et pariatur" + }, + { + "namespace": "tempor" + }, + { + "namespace": "in" + }, + { + "namespace": "proident dese" + } + ], + "created": "1979-10-29T00:00:00.0Z", + "per_reporter_staleness": { + "dolor81b": { + "check_in_succeeded": true, + "last_check_in": "1949-01-14T23:00:00.0Z", + "stale_timestamp": "1988-04-18T22:00:00.0Z" + } + }, + "subscription_manager_id": "in dolor nostrud occaecat i", + "fqdn": "veniam ipsum", + "account": null, + "stale_timestamp": null, + "reporter": "ex ut ad nostrud", + "id": "eu quis nostrud", + "ansible_host": null + }, + { + "org_id": "irure consectetur cillum Excepteur", + "id": "reprehenderit et non dolore", + "provider_id": null, + "account": null, + "per_reporter_staleness": { + "in0b": { + "stale_timestamp": "1975-09-10T23:00:00.0Z", + "check_in_succeeded": true, + "last_check_in": "1984-03-26T22:00:00.0Z" + }, + "mollit9e": { + "stale_timestamp": "1960-11-03T23:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "1962-02-02T23:00:00.0Z" + }, + "cupidatat1e": { + "stale_timestamp": "1999-02-10T23:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "1984-09-05T22:00:00.0Z" + }, + "pariatur32e": { + "stale_timestamp": "2001-04-20T22:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "2006-01-12T23:00:00.0Z" + } + }, + "ansible_host": "deserunt velit", + "satellite_id": "cupidatat aute dolor fugiat nulla", + "created": "1991-09-26T22:00:00.0Z", + "facts": [ + { + "namespace": "quis ut ut irure" + }, + { + "namespace": "quis ut con" + }, + { + "namespace": "qui" + }, + { + "namespace": "non ea irure consequat" + }, + { + "namespace": "do" + }, + { + "namespace": "dolore" + }, + { + "namespace": "sint dolor qui" + }, + { + "namespace": "do tempor aute" + }, + { + "namespace": "sint eiusmod consequat fugia" + }, + { + "namespace": "voluptate laboris sed consequat do" + }, + { + "namespace": "pariatur tempor voluptate proident aliqua" + }, + { + "namespace": "adipisicing sunt consectetur" + }, + { + "namespace": "consequat ut sed et" + }, + { + "namespace": "esse in quis" + }, + { + "namespace": "pariatur Lorem ut" + }, + { + "namespace": "exercitation " + }, + { + "namespace": "reprehenderit eu sed id esse" + }, + { + "namespace": "in ad quis nulla" + }, + { + "namespace": "dolore sed magna laboris" + }, + { + "namespace": "ullamco aute" + } + ], + "culled_timestamp": null, + "stale_timestamp": null, + "insights_id": "tempor d", + "reporter": "velit occaecat", + "updated": "1960-03-18T23:00:00.0Z", + "provider_type": "aute sunt exercitation", + "display_name": "enim do", + "ip_addresses": null, + "mac_addresses": [ + "qui", + "dolor non in sed ipsum", + "cillum dolor", + "cillum voluptate id ex officia", + "magna", + "in est consectetur sed", + "sit fugiat ea aute veniam", + "voluptate", + "voluptate", + "Excepteur laboris Lorem Ut", + "sunt sed nostrud sit qui", + "in eiusmod", + "si", + "in Ut cupidatat eu", + "aute ut", + "velit", + "occaecat", + "eu velit pariatur", + "sed adipisicing consequat", + "laborum mollit" + ], + "subscription_manager_id": null, + "bios_uuid": "minim enim cillum quis", + "fqdn": null, + "stale_warning_timestamp": "1998-10-05T22:00:00.0Z" + }, + { + "org_id": "Duis magna do", + "provider_id": null, + "facts": [ + { + "namespace": "sunt mollit ea" + }, + { + "namespace": "ut Duis eu cupidatat ea" + }, + { + "namespace": "amet in ad" + }, + { + "namespace": "ad esse est" + }, + { + "namespace": "quis nisi pariatur" + }, + { + "namespace": "est ex sunt" + }, + { + "namespace": "dolor Lorem cons" + }, + { + "namespace": "dolore" + }, + { + "namespace": "officia elit eu velit" + }, + { + "namespace": "dolor qui" + }, + { + "namespace": "consectetur magna proident voluptate" + }, + { + "namespace": "eu eiusmod mollit sit" + }, + { + "namespace": "proident cupidatat aute culpa id" + }, + { + "namespace": "officia dolor consequat esse" + }, + { + "namespace": "ut proident elit in minim" + }, + { + "namespace": "consectet" + }, + { + "namespace": "ad amet eu tempor" + }, + { + "namespace": "elit in eu exercitation non" + }, + { + "namespace": "Excepteur tempor et Lorem exercitati" + }, + { + "namespace": "eiusmod mollit in pariatur" + } + ], + "updated": "1946-11-14T00:00:00.0Z", + "reporter": null, + "id": "dolore amet", + "ip_addresses": [ + "incididunt", + "adipisicing", + "velit nulla", + "elit ex in minim", + "consectetur quis", + "", + "mollit ullamco id", + "voluptate ut occaecat", + "sint", + "Lorem", + "in ea ", + "ut consequa", + "velit non a", + "qui dolor Duis fugiat", + "tempor pariatur elit ut laborum", + "pariatur", + "esse", + "sint", + "sint in id elit velit", + "Duis quis proident" + ], + "stale_warning_timestamp": "1973-04-13T23:00:00.0Z", + "provider_type": "nulla magna", + "per_reporter_staleness": { + "nulla_8": { + "check_in_succeeded": true, + "stale_timestamp": "1946-08-27T22:00:00.0Z", + "last_check_in": "1965-01-17T23:00:00.0Z" + }, + "Excepteur_b": { + "stale_timestamp": "1994-04-14T22:00:00.0Z", + "last_check_in": "1944-06-27T22:00:00.0Z", + "check_in_succeeded": false + } + }, + "display_name": null, + "insights_id": "et irure", + "culled_timestamp": "2010-12-13T00:00:00.0Z", + "stale_timestamp": "1950-11-27T00:00:00.0Z", + "mac_addresses": null, + "ansible_host": "do culpa dolor veniam ullamco", + "fqdn": null, + "satellite_id": "amet", + "created": "1954-10-15T00:00:00.0Z", + "bios_uuid": "ipsum est in dolor occaecat", + "account": "labori", + "subscription_manager_id": "sed ani" + }, + { + "org_id": "dolor", + "satellite_id": null, + "insights_id": null, + "bios_uuid": "minim labore", + "updated": "1991-03-27T23:00:00.0Z", + "subscription_manager_id": null, + "ip_addresses": null, + "per_reporter_staleness": { + "aliquip6": { + "stale_timestamp": "1993-05-22T22:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "1989-03-07T23:00:00.0Z" + } + }, + "fqdn": "ea cillum laborum", + "display_name": "reprehenderit et ipsum dolore culpa", + "id": "cillum et laborum", + "stale_timestamp": null, + "stale_warning_timestamp": null, + "facts": [ + { + "namespace": "Ut" + }, + { + "namespace": "laborum ipsum" + }, + { + "namespace": "ipsum quis occaecat do" + }, + { + "namespace": "dolore sed consequ" + }, + { + "namespace": "mollit" + }, + { + "namespace": "non reprehenderit nisi exercitation" + }, + { + "namespace": "nisi" + }, + { + "namespace": "quis deserunt commodo sit ex" + }, + { + "namespace": "reprehenderit exercitation" + }, + { + "namespace": "ullamco cupidatat tempor" + }, + { + "namespace": "pariatur" + }, + { + "namespace": "labore ma" + }, + { + "namespace": "elit" + }, + { + "namespace": "labore in culpa mollit" + }, + { + "namespace": "esse cupidatat aliquip nisi" + }, + { + "namespace": "pariatur ut est" + }, + { + "namespace": "id" + }, + { + "namespace": "non eiusmod o" + }, + { + "namespace": "ex no" + }, + { + "namespace": "aute dolor dolore sunt" + } + ], + "mac_addresses": [ + "velit officia esse", + "in e", + "", + "ad fugiat nisi elit Duis", + "labore mollit", + "reprehenderit", + "ipsum voluptate", + "fugiat sed velit quis ", + "qui nostrud est fugiat", + "ullamco", + "dolore in Ut aliquip", + "sed dolor id culpa", + "est ipsum sed Excepteur", + "id", + "cillum enim culpa", + "dolor ea", + "laboris", + "dolor fugiat", + "ullamco ip", + "dolor dolore nos" + ], + "ansible_host": null, + "account": null, + "provider_id": null, + "provider_type": null, + "culled_timestamp": null, + "reporter": "laboris q", + "created": "2003-04-02T22:00:00.0Z" + }, + { + "org_id": "voluptate dolor sit", + "display_name": null, + "per_reporter_staleness": { + "inf97": { + "last_check_in": "1982-12-23T00:00:00.0Z", + "stale_timestamp": "1987-07-05T22:00:00.0Z", + "check_in_succeeded": false + }, + "sit_a": { + "stale_timestamp": "1966-09-06T23:00:00.0Z", + "last_check_in": "1948-02-09T23:00:00.0Z", + "check_in_succeeded": true + } + }, + "insights_id": null, + "satellite_id": null, + "account": "occaecat sunt", + "fqdn": null, + "subscription_manager_id": null, + "updated": "2010-04-17T22:00:00.0Z", + "facts": [ + { + "namespace": "minim" + }, + { + "namespace": "velit labore cillum ea" + }, + { + "namespace": "sunt anim laboris" + }, + { + "namespace": "sint proident" + }, + { + "namespace": "sed nulla irure sint" + }, + { + "namespace": "repreh" + }, + { + "namespace": "commodo quis anim " + }, + { + "namespace": "consectetur Lorem reprehenderit" + }, + { + "namespace": "sunt" + }, + { + "namespace": "irure eu do" + }, + { + "namespace": "minim Lorem" + }, + { + "namespace": "reprehenderit" + }, + { + "namespace": "qui" + }, + { + "namespace": "laboris culpa non dolore sit" + }, + { + "namespace": "sunt est Excepteur" + }, + { + "namespace": "do culpa" + }, + { + "namespace": "Ut" + }, + { + "namespace": "ipsum" + }, + { + "namespace": "nulla" + }, + { + "namespace": "cillum" + } + ], + "ip_addresses": [ + "velit sed do", + "esse fugiat pariatu", + "Excepteur proident exercita", + "veniam nisi", + "non qui", + "reprehenderit sed quis", + "Excepteur qui in", + "sit Excepteur ea qui irure", + "id enim veniam deserunt tempor", + "dolore elit culpa do aliquip", + "Excepteur esse dolore id eu", + "dolore", + "sunt non in qui", + "sed", + "dolor", + "proident nostrud Duis dolor", + "par", + "dolore aute quis nulla nisi", + "eiusmod laborum in", + "ullamco proident dolore ex id" + ], + "ansible_host": null, + "stale_timestamp": "2002-07-30T22:00:00.0Z", + "created": "1967-03-04T23:00:00.0Z", + "stale_warning_timestamp": null, + "provider_type": null, + "reporter": "ipsum aliqua", + "provider_id": "velit dolore", + "bios_uuid": null, + "mac_addresses": [ + "irure non reprehenderit aute", + "occaecat", + "sit", + "dolore ad Ut moll", + "in aliqua non ea esse", + "labore", + "proident ut", + "commodo dolore pariatur ipsum ex", + "quis mollit consequat ex est", + "amet dolor eu sed Ut", + "non Lorem Duis aliqua", + "ad nisi", + "cillum eiusmod nisi", + "labore amet deserunt veniam", + "ipsu", + "sunt", + "", + "dolore elit amet", + "eu ipsum mollit ut amet", + "commodo labore fugiat" + ], + "culled_timestamp": null, + "id": "dolor culpa" + }, + { + "org_id": "esse irure reprehenderit ad", + "bios_uuid": null, + "created": "2012-03-24T23:00:00.0Z", + "satellite_id": null, + "fqdn": "irure do ullamco", + "insights_id": "cillum in laboris ex ad", + "subscription_manager_id": null, + "per_reporter_staleness": { + "adipisicing_c": { + "last_check_in": "1965-03-17T23:00:00.0Z", + "stale_timestamp": "1946-12-22T00:00:00.0Z", + "check_in_succeeded": false + }, + "etc18": { + "check_in_succeeded": false, + "last_check_in": "2015-08-11T22:00:00.0Z", + "stale_timestamp": "1964-09-05T23:00:00.0Z" + }, + "dolore_27": { + "stale_timestamp": "2002-03-24T23:00:00.0Z", + "check_in_succeeded": false, + "last_check_in": "2016-11-28T00:00:00.0Z" + }, + "nulla1d": { + "last_check_in": "1947-11-16T00:00:00.0Z", + "stale_timestamp": "2002-11-22T00:00:00.0Z", + "check_in_succeeded": false + } + }, + "id": "pariatur aute ut", + "updated": "1991-03-03T23:00:00.0Z", + "provider_type": "dolor", + "culled_timestamp": "1995-09-17T22:00:00.0Z", + "ip_addresses": [ + "quis no", + "ea ullamco deserunt ", + "proident", + "incididunt commo", + "nostrud pariatur deserunt esse", + "ullamco", + "Duis", + "consequat Excepteur in aliquip nulla", + "velit nostrud exe", + "Ut Excepteur non consectetur", + "Lorem sed minim laboris Duis", + "eiusmod ad ullamco culpa", + "sit", + "qui", + "est officia cupidatat Ut non", + "officia", + "in ut", + "reprehenderit est", + "eiusmod Duis aliquip", + "enim reprehenderit eu" + ], + "facts": [ + { + "namespace": "veniam in Ut" + }, + { + "namespace": "incididunt fugiat ipsum minim" + }, + { + "namespace": "quis" + }, + { + "namespace": "ex qui cillum" + }, + { + "namespace": "nostrud" + }, + { + "namespace": "sed velit" + }, + { + "namespace": "quis eli" + }, + { + "namespace": "ex veniam in fugiat" + }, + { + "namespace": "proident commodo officia" + }, + { + "namespace": "aliqua" + }, + { + "namespace": "minim" + }, + { + "namespace": "ipsum aliquip cupidatat" + }, + { + "namespace": "fugiat in" + }, + { + "namespace": "sint ea mollit" + }, + { + "namespace": "voluptate" + }, + { + "namespace": "esse commodo" + }, + { + "namespace": "nulla" + }, + { + "namespace": "dolor ullamco quis velit esse" + }, + { + "namespace": "nostrud" + }, + { + "namespace": "proident" + } + ], + "ansible_host": null, + "provider_id": "aliquip Ut eni", + "reporter": null, + "account": null, + "display_name": null, + "stale_warning_timestamp": "1958-08-14T23:00:00.0Z", + "stale_timestamp": null, + "mac_addresses": null + } + ], + "total": 630 +} diff --git a/cypress/support/interceptors.js b/cypress/support/interceptors.js index df484615d..4c42f9e3b 100644 --- a/cypress/support/interceptors.js +++ b/cypress/support/interceptors.js @@ -1,8 +1,11 @@ /* eslint-disable camelcase */ import { DEFAULT_ROW_COUNT } from '@redhat-cloud-services/frontend-components-utilities'; + +// fixtures generated by prism mock server import fixtures from '../fixtures/groups.json'; import groupsSecondPage from '../fixtures/groupsSecondPage.json'; import groupDetailFixtures from '../fixtures/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C.json'; +import hostsFixtures from '../fixtures/hosts.json'; export const groupsInterceptors = { 'successful with some items': () => @@ -114,3 +117,53 @@ export const deleteGroupsInterceptors = { }).as('deleteGroups'); } }; + +export const hostsInterceptors = { + successful: () => { + cy.intercept('GET', '/api/inventory/v1/hosts*', { + statusCode: 200, + body: hostsFixtures + }).as('getHosts'); + }, + 'successful empty': () => { + cy.intercept('GET', '/api/inventory/v1/hosts*', { + statusCode: 200, + body: { + count: 0, + page: 1, + per_page: DEFAULT_ROW_COUNT, + total: 0 + } + }).as('getHosts'); + }, + 'failed with server error': () => { + Cypress.on('uncaught:exception', () => { + return false; + }); + cy.intercept('GET', '/api/inventory/v1/hosts*', { statusCode: 500 }).as( + 'getHosts' + ); + } +}; + +export const systemProfileInterceptors = { + 'operating system, successful empty': () => { + cy.intercept('GET', '/api/inventory/v1/system_profile/operating_system', { + statusCode: 200, + body: { + results: [] + } + }).as('getSystemProfile'); + } +}; + +export const featureFlagsInterceptors = { + successful: () => { + cy.intercept('GET', '/feature_flags*', { + statusCode: 200, + body: { + toggles: [] + } + }).as('getFeatureFlag'); + } +}; diff --git a/cypress/support/utils.js b/cypress/support/utils.js new file mode 100644 index 000000000..80ca08455 --- /dev/null +++ b/cypress/support/utils.js @@ -0,0 +1,24 @@ +import { ROW } from '@redhat-cloud-services/frontend-components-utilities'; + +export const ORDER_TO_URL = { + ascending: 'ASC', + descending: 'DESC' +}; + +export const selectRowN = (number) => { + cy.get(ROW).eq(number).find('.pf-c-table__check').click(); +}; + +export const checkSelectedNumber = (number, selector = '#toggle-checkbox-text') => { + if (number === 0) { + cy.get(selector).should('not.exist'); + } else { + cy.get(selector).should('have.text', `${number} selected`); + } +}; + +export const unleashDummyConfig = { + url: 'http://localhost:8002/feature_flags', + clientKey: 'abc', + appName: 'abc' +}; diff --git a/src/api/api.js b/src/api/api.js index 64ff7f9b0..46a6240ae 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -110,7 +110,7 @@ export async function getEntities(items, { page, orderBy, orderDirection, - fields = { system_profile: ['operating_system'] }, + fields = { system_profile: ['operating_system', /* needed by inventory groups */ 'system_update_method'] }, ...options }, showTags) { diff --git a/src/components/GroupSystems/GroupSystems.cy.js b/src/components/GroupSystems/GroupSystems.cy.js new file mode 100644 index 000000000..16c7a3e7d --- /dev/null +++ b/src/components/GroupSystems/GroupSystems.cy.js @@ -0,0 +1,321 @@ +import { mount } from '@cypress/react'; +import { + changePagination, + checkEmptyState, + checkPaginationTotal, + checkPaginationValues, + checkTableHeaders, + CHIP, + CHIP_GROUP, + DROPDOWN_TOGGLE, + hasChip, + PAGINATION_VALUES, + SORTING_ORDERS, + TEXT_INPUT, + TOOLBAR, + TOOLBAR_FILTER +} from '@redhat-cloud-services/frontend-components-utilities'; +import FlagProvider from '@unleash/proxy-client-react'; +import React from 'react'; +import { Provider } from 'react-redux'; +import { MemoryRouter } from 'react-router-dom'; +import { + featureFlagsInterceptors, + hostsInterceptors, + systemProfileInterceptors +} from '../../../cypress/support/interceptors'; +import { getStore } from '../../store'; +import GroupSystems from './GroupSystems'; +import fixtures from '../../../cypress/fixtures/hosts.json'; +import { + checkSelectedNumber as checkSelectedNumber_, + ORDER_TO_URL, + selectRowN, + unleashDummyConfig +} from '../../../cypress/support/utils'; +import _ from 'lodash'; + +const GROUP_NAME = 'foobar'; +const ROOT = 'div[id="group-systems-table"]'; +const TABLE_HEADERS = ['Name', 'Tags', 'OS', 'Update methods', 'Last seen']; +const SORTABLE_HEADERS = ['Name', 'OS', 'Last seen']; +const DEFAULT_ROW_COUNT = 50; + +const checkSelectedNumber = (number) => + checkSelectedNumber_(number, '#bulk-select-groups-toggle-checkbox-text'); + +const mountTable = () => + mount( + + + + + + + + ); + +before(() => { + cy.window().then( + (window) => + (window.insights = { + chrome: { + isProd: false, + auth: { + getUser: () => { + return Promise.resolve({}); + } + } + } + }) + ); +}); + +describe('renders correctly', () => { + beforeEach(() => { + hostsInterceptors.successful(); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + }); + + it('the root container is rendered', () => { + cy.get(ROOT); + }); + + it('renders toolbar', () => { + cy.get(TOOLBAR).should('have.length', 1); + }); + + it('renders table header', () => { + checkTableHeaders(TABLE_HEADERS); + }); +}); + +describe('defaults', () => { + beforeEach(() => { + hostsInterceptors.successful(); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + }); + + it(`pagination is set to ${DEFAULT_ROW_COUNT}`, () => { + cy.get('.pf-c-options-menu__toggle-text') + .find('b') + .eq(0) + .should('have.text', `1 - ${DEFAULT_ROW_COUNT}`); + }); + + it('name filter is a default filter', () => { + cy.get(TOOLBAR_FILTER).find(TEXT_INPUT).should('exist'); + }); +}); + +describe('pagination', () => { + beforeEach(() => { + hostsInterceptors.successful(); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + }); + + it('shows correct total number of groups', () => { + checkPaginationTotal(fixtures.total); + }); + + it('values are expected ones', () => { + checkPaginationValues(PAGINATION_VALUES); + }); + + it('can change page limit', () => { + PAGINATION_VALUES.forEach((el) => { + changePagination(el).then(() => { + cy.wait('@getHosts') + .its('request.url') + .should('include', `per_page=${el}`); + }); + }); + }); + + it('can change page', () => { + cy.get('button[data-action=next]').eq(0).click(); // click "next page" button + cy.wait('@getHosts').its('request.url').should('include', `page=2`); + }); +}); + +describe('sorting', () => { + beforeEach(() => { + hostsInterceptors.successful(); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + }); + + const checkSorting = (label, order, dataField) => { + // get appropriate locators + const header = `th[data-label="${label}"]`; + if (order === 'ascending') { + cy.get(header).find('button').click(); + } else { + cy.get(header).find('button').click(); + cy.wait('@getHosts'); // TODO: implement debounce for sorting feature + cy.get(header).find('button').click(); + } + + cy.wait('@getHosts') + .its('request.url') + .should('include', `order_how=${ORDER_TO_URL[order]}`) + .and('include', `order_by=${dataField}`); + }; + + _.zip( + ['display_name', 'operating_system', 'updated'], + SORTABLE_HEADERS + ).forEach(([category, label]) => { + SORTING_ORDERS.forEach((order) => { + it(`${order} by ${label}`, () => { + checkSorting(label, order, category); + }); + }); + }); +}); + +describe('filtering', () => { + beforeEach(() => { + hostsInterceptors.successful(); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + }); + + const applyNameFilter = () => + cy.get('.ins-c-primary-toolbar__filter').find('input').type('lorem'); + it('renders filter chip', () => { + applyNameFilter(); + hasChip('Display name', 'lorem'); + cy.wait('@getHosts'); + }); + + it('sends correct request', () => { + applyNameFilter(); + cy.wait('@getHosts') + .its('request.url') + .should('include', 'hostname_or_id=lorem'); + }); + + it('can remove the chip or reset filters', () => { + applyNameFilter(); + cy.wait('@getHosts') + .its('request.url') + .should('contain', 'hostname_or_id=lorem'); + cy.get(CHIP_GROUP) + .find(CHIP) + .ouiaId('close', 'button') + .each(() => { + cy.get(CHIP_GROUP).find(CHIP).ouiaId('close', 'button'); + }); + cy.get('button').contains('Reset filters').click(); + cy.wait('@getHosts') + .its('request.url') + .should('not.contain', 'hostname_or_id'); + + cy.get(CHIP_GROUP).should('not.exist'); + + cy.wait('@getHosts'); // TODO: reset filters shouldn't trigger this second extra call + }); + + // TODO: add more filter cases +}); + +describe('selection and bulk selection', () => { + beforeEach(() => { + hostsInterceptors.successful(); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + }); + + it('can select and deselect systems', () => { + const middleRow = Math.ceil(DEFAULT_ROW_COUNT / 4); + selectRowN(middleRow); + checkSelectedNumber(1); + selectRowN(Math.ceil(middleRow / 2)); + checkSelectedNumber(2); + selectRowN(middleRow); + checkSelectedNumber(1); + }); + + /* it('can select all in dropdown toggle', () => { + cy.get(DROPDOWN_TOGGLE).eq(0).click(); // open selection dropdown + cy.get('.pf-c-dropdown__menu > li').eq(2).click(); + checkSelectedNumber(fixtures.total); + }); */ + + /* it('can select all by clicking checkbox', () => { + cy.get('#toggle-checkbox').eq(0).click(); + checkSelectedNumber(fixtures.total); + cy.get('#toggle-checkbox').eq(0).click(); + checkSelectedNumber(0); + }); */ + + it('can select page in dropdown toggle', () => { + cy.get(DROPDOWN_TOGGLE).eq(0).click(); // open selection dropdown + cy.get('.pf-c-dropdown__menu > li').eq(1).click(); + checkSelectedNumber(fixtures.count); + }); + + it('can select page by clicking checkbox', () => { + cy.get('#bulk-select-groups-toggle-checkbox').eq(0).click(); + checkSelectedNumber(fixtures.count); + cy.get('#bulk-select-groups-toggle-checkbox').eq(0).click(); + checkSelectedNumber(0); + }); + + it('can select none', () => { + selectRowN(1); + cy.get(DROPDOWN_TOGGLE).eq(0).click(); // open selection dropdown + cy.get('.pf-c-dropdown__menu > li').eq(1).click(); + checkSelectedNumber(0); + }); +}); + +describe('actions', () => { + // TBA +}); + +describe('edge cases', () => { + it('no groups match', () => { + hostsInterceptors['successful empty'](); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + + checkEmptyState('No matching systems found', true); + checkPaginationTotal(0); + }); + + it('failed request', () => { + hostsInterceptors['failed with server error'](); + featureFlagsInterceptors.successful(); + systemProfileInterceptors['operating system, successful empty'](); + mountTable(); + + cy.wait('@getHosts'); + cy.get('.pf-c-empty-state').find('h4').contains('Something went wrong'); + }); +}); diff --git a/src/components/GroupSystems/GroupSystems.js b/src/components/GroupSystems/GroupSystems.js new file mode 100644 index 000000000..d02d42118 --- /dev/null +++ b/src/components/GroupSystems/GroupSystems.js @@ -0,0 +1,99 @@ +import { fitContent, TableVariant } from '@patternfly/react-table'; +import difference from 'lodash/difference'; +import map from 'lodash/map'; +import PropTypes from 'prop-types'; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { selectEntity } from '../../store/inventory-actions'; +import InventoryTable from '../InventoryTable/InventoryTable'; + +const prepareColumns = (initialColumns) => { + // hides the "groups" column + const columns = initialColumns.filter(({ key }) => key !== 'groups'); + + // additionally insert the "update methods" column + columns.splice(columns.length - 1 /* must be penultimate */, 0, { + key: 'update_method', + title: 'Update methods', + sortKey: 'update_method', + transforms: [fitContent], + renderFunc: (value, hostId, systemData) => + systemData?.system_profile?.system_update_method || 'N/A', + props: { + // TODO: remove isStatic when the sorting is supported by API + isStatic: true, + width: 10 + } + }); + + return columns; +}; + +const GroupSystems = ({ groupName }) => { + const dispatch = useDispatch(); + + const selected = useSelector( + (state) => state?.entities?.selected || new Map() + ); + const rows = useSelector(({ entities }) => entities?.rows || []); + + const noneSelected = selected.size === 0; + const displayedIds = map(rows, 'id'); + const pageSelected = + difference(displayedIds, [...selected.keys()]).length === 0; + + return ( +
+ + await defaultGetEntities( + items, + // filter systems by the group name + { + ...config, + filters: { + ...config.filters, + groupName: [groupName] // TODO: the param is not yet supported by `apiHostGetHostList` + } + }, + showTags + ) + } + tableProps={{ + isStickyHeader: true, + variant: TableVariant.compact, + canSelectAll: false + }} + bulkSelect={{ + count: selected.size, + id: 'bulk-select-groups', + items: [ + { + title: 'Select none (0)', + onClick: () => dispatch(selectEntity(-1, false)), + props: { isDisabled: noneSelected } + }, + { + title: `${pageSelected ? 'Deselect' : 'Select'} page (${ + rows.length + } items)`, + onClick: () => dispatch(selectEntity(0, !pageSelected)) + } + // TODO: Implement "select all" + ], + onSelect: (value) => { + dispatch(selectEntity(0, value)); + }, + checked: selected.size > 0 // TODO: support partial selection (dash sign) in FEC BulkSelect + }} + /> +
+ ); +}; + +GroupSystems.propTypes = { + groupName: PropTypes.string.isRequired +}; + +export default GroupSystems; diff --git a/src/components/GroupSystems/index.js b/src/components/GroupSystems/index.js new file mode 100644 index 000000000..e2c71c39b --- /dev/null +++ b/src/components/GroupSystems/index.js @@ -0,0 +1,29 @@ +import { EmptyState, EmptyStateBody, Spinner } from '@patternfly/react-core'; +import PropTypes from 'prop-types'; +import React from 'react'; +import { useSelector } from 'react-redux'; +import NoGroupsEmptyState from '../InventoryGroups/NoGroupsEmptyState'; +import GroupSystems from './GroupSystems'; + +const GroupSystemsWrapper = ({ groupName }) => { + const { uninitialized, loading, data } = useSelector((state) => state.groupDetail); + const hosts = data?.results?.[0]?.host_ids /* can be null */ || []; + + return uninitialized || loading ? ( + + + + + + ) : hosts.length > 0 ? ( + + ) : + ; +}; + +GroupSystemsWrapper.propTypes = { + groupName: PropTypes.string.isRequired +}; + +export default GroupSystemsWrapper; +export { GroupSystems }; diff --git a/src/components/GroupsTable/GroupsTable.cy.js b/src/components/GroupsTable/GroupsTable.cy.js index 4a0fba9a0..701461d35 100644 --- a/src/components/GroupsTable/GroupsTable.cy.js +++ b/src/components/GroupsTable/GroupsTable.cy.js @@ -26,30 +26,14 @@ import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router-dom'; import fixtures from '../../../cypress/fixtures/groups.json'; import { groupsInterceptors as interceptors } from '../../../cypress/support/interceptors'; +import { checkSelectedNumber, ORDER_TO_URL, selectRowN } from '../../../cypress/support/utils'; import { getStore } from '../../store'; import GroupsTable from './GroupsTable'; -const ORDER_TO_URL = { - ascending: 'ASC', - descending: 'DESC' -}; - const DEFAULT_ROW_COUNT = 50; const TABLE_HEADERS = ['Name', 'Total systems', 'Last modified']; const ROOT = 'div[id="groups-table"]'; -export const checkSelectedNumber = (number) => { - if (number === 0) { - cy.get('#toggle-checkbox-text').should('not.exist'); - } else { - cy.get('#toggle-checkbox-text').should('have.text', `${number} selected`); - } -}; - -export const selectRowN = (number) => { - cy.get(ROW).eq(number).find('.pf-c-table__check').click(); -}; - const mountTable = () => mount( diff --git a/src/components/InventoryGroupDetail/GroupDetailSystems.js b/src/components/InventoryGroupDetail/GroupDetailSystems.js deleted file mode 100644 index e9470ce71..000000000 --- a/src/components/InventoryGroupDetail/GroupDetailSystems.js +++ /dev/null @@ -1,22 +0,0 @@ -import { EmptyState, EmptyStateBody, Spinner } from '@patternfly/react-core'; -import React from 'react'; -import { useSelector } from 'react-redux'; -import NoSystemsEmptyState from './NoSystemsEmptyState'; - -const GroupDetailSystems = () => { - const { uninitialized, loading } = useSelector((state) => state.groupDetail); - - // TODO: integrate the inventory table - - return (uninitialized || loading ? - - - - - - : - - ); -}; - -export default GroupDetailSystems; diff --git a/src/components/InventoryGroupDetail/InventoryGroupDetail.js b/src/components/InventoryGroupDetail/InventoryGroupDetail.js index 816d81043..2471651b1 100644 --- a/src/components/InventoryGroupDetail/InventoryGroupDetail.js +++ b/src/components/InventoryGroupDetail/InventoryGroupDetail.js @@ -1,7 +1,3 @@ -import React, { lazy, Suspense, useEffect } from 'react'; -import useChrome from '@redhat-cloud-services/frontend-components/useChrome'; -import { useDispatch, useSelector } from 'react-redux'; -import { fetchGroupDetail } from '../../store/inventory-actions'; import { Bullseye, PageSection, @@ -10,10 +6,13 @@ import { Tabs, TabTitleText } from '@patternfly/react-core'; -import { useState } from 'react'; -import GroupDetailHeader from './GroupDetailHeader'; -import GroupDetailSystems from './GroupDetailSystems'; +import useChrome from '@redhat-cloud-services/frontend-components/useChrome'; import PropTypes from 'prop-types'; +import React, { lazy, Suspense, useEffect, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { fetchGroupDetail } from '../../store/inventory-actions'; +import GroupSystems from '../GroupSystems'; +import GroupDetailHeader from './GroupDetailHeader'; const GroupDetailInfo = lazy(() => import('./GroupDetailInfo')); @@ -21,6 +20,7 @@ const InventoryGroupDetail = ({ groupId }) => { const dispatch = useDispatch(); const { data } = useSelector((state) => state.groupDetail); const chrome = useChrome(); + const groupName = data?.results?.[0]?.name; useEffect(() => { dispatch(fetchGroupDetail(groupId)); @@ -29,7 +29,7 @@ const InventoryGroupDetail = ({ groupId }) => { useEffect(() => { // if available, change ID to the group's name in the window title chrome?.updateDocumentTitle?.( - `${data?.name || groupId} - Inventory Groups | Red Hat Insights` + `${groupName || groupId} - Inventory Groups | Red Hat Insights` ); }, [data]); @@ -54,7 +54,7 @@ const InventoryGroupDetail = ({ groupId }) => { aria-label="Group systems tab" > - + ([ } > : new Date(value).toLocaleString(); }, - props: { width: 10 } + props: { width: 10 }, + transforms: [fitContent] } ]);