From b1614199f02e2ffe890124a806ea0f26a738df1d Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Thu, 14 Sep 2023 12:18:55 -0400 Subject: [PATCH 1/5] Update modal --- .../integration/version/name_change_modal.ts | 16 +- package.json | 6 +- src/gql/generated/types.ts | 14 ++ yarn.lock | 206 ++++++++---------- 4 files changed, 114 insertions(+), 128 deletions(-) diff --git a/cypress/integration/version/name_change_modal.ts b/cypress/integration/version/name_change_modal.ts index 974b60703a..25556ca35f 100644 --- a/cypress/integration/version/name_change_modal.ts +++ b/cypress/integration/version/name_change_modal.ts @@ -8,14 +8,16 @@ describe("Name change modal", () => { cy.contains(originalName); cy.dataCy("name-change-modal-trigger").click(); const newName = "a different name"; - cy.get("textarea").clear().type(newName); + cy.get("textarea").clear(); + cy.get("textarea").type(newName); cy.contains("Confirm").click(); cy.get("textarea").should("not.exist"); cy.contains(newName); cy.validateToast("success", "Patch name was successfully updated.", true); // revert name change cy.dataCy("name-change-modal-trigger").click(); - cy.get("textarea").clear().type(originalName); + cy.get("textarea").clear(); + cy.get("textarea").type(originalName); cy.contains("Confirm").click(); cy.get("textarea").should("not.exist"); cy.validateToast("success", "Patch name was successfully updated.", true); @@ -25,13 +27,17 @@ describe("Name change modal", () => { it("The confirm button is disabled when the text area value is empty or greater than 300 characters", () => { cy.dataCy("name-change-modal-trigger").click(); cy.get("textarea").clear(); - cy.contains("button", "Confirm").should("be.disabled"); + cy.contains("button", "Confirm").should("have.attr", "aria-disabled", true); cy.get("textarea").type("lol"); - cy.contains("button", "Confirm").should("not.be.disabled"); + cy.contains("button", "Confirm").should( + "have.attr", + "aria-disabled", + false + ); const over300Chars = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; cy.get("textarea").type(over300Chars); - cy.contains("button", "Confirm").should("be.disabled"); + cy.contains("button", "Confirm").should("have.attr", "aria-disabled", true); cy.contains("Value cannot exceed 300 characters"); }); }); diff --git a/package.json b/package.json index 1d3206524a..6bd4266b19 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@leafygreen-ui/checkbox": "12.0.5", "@leafygreen-ui/code": "14.0.1", "@leafygreen-ui/combobox": "5.0.7", - "@leafygreen-ui/confirmation-modal": "4.0.3", + "@leafygreen-ui/confirmation-modal": "5.0.6", "@leafygreen-ui/emotion": "4.0.3", "@leafygreen-ui/expandable-card": "3.0.5", "@leafygreen-ui/guide-cue": "3.0.0", @@ -78,9 +78,9 @@ "@leafygreen-ui/interaction-ring": "7.0.2", "@leafygreen-ui/leafygreen-provider": "3.1.0", "@leafygreen-ui/loading-indicator": "2.0.5", - "@leafygreen-ui/marketing-modal": "^4.0.5", + "@leafygreen-ui/marketing-modal": "^4.1.0", "@leafygreen-ui/menu": "20.0.1", - "@leafygreen-ui/modal": "14.0.1", + "@leafygreen-ui/modal": "16.0.1", "@leafygreen-ui/number-input": "1.0.4", "@leafygreen-ui/pagination": "1.0.12", "@leafygreen-ui/palette": "4.0.7", diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 59f47f7dd8..a518e5d843 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -258,6 +258,19 @@ export enum CommunicationMethod { Ssh = "SSH", } +export type ContainerPool = { + __typename?: "ContainerPool"; + distro: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + maxContainers: Scalars["Int"]["output"]; + port: Scalars["Int"]["output"]; +}; + +export type ContainerPoolsConfig = { + __typename?: "ContainerPoolsConfig"; + pools: Array; +}; + export type ContainerResources = { __typename?: "ContainerResources"; cpu: Scalars["Int"]["output"]; @@ -2330,6 +2343,7 @@ export type SpruceConfig = { __typename?: "SpruceConfig"; banner?: Maybe; bannerTheme?: Maybe; + containerPools?: Maybe; githubOrgs: Array; jira?: Maybe; keys: Array; diff --git a/yarn.lock b/yarn.lock index c070c3963e..3fe07c7b12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3325,19 +3325,6 @@ "@leafygreen-ui/tokens" "^2.1.1" polished "^4.2.2" -"@leafygreen-ui/button@^21.0.0": - version "21.0.1" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/button/-/button-21.0.1.tgz#e10030fb6104f40c8d595129df331209b514e619" - integrity sha512-lhnh5SHTNrdT825AVR6ARTd7ox0J7kfNH6d1a+DMLIrnXkVgTs2uCGw9c1dBV5x8+CK+oxqx6aP7hTMUgruZog== - dependencies: - "@leafygreen-ui/box" "^3.1.4" - "@leafygreen-ui/emotion" "^4.0.4" - "@leafygreen-ui/lib" "^10.4.0" - "@leafygreen-ui/palette" "^4.0.4" - "@leafygreen-ui/ripple" "^1.1.9" - "@leafygreen-ui/tokens" "^2.1.1" - polished "^4.2.2" - "@leafygreen-ui/button@^21.0.3": version "21.0.4" resolved "https://registry.yarnpkg.com/@leafygreen-ui/button/-/button-21.0.4.tgz#a33242102b34484a57ca949e8dc7233c82403d54" @@ -3351,6 +3338,19 @@ "@leafygreen-ui/tokens" "^2.1.4" polished "^4.2.2" +"@leafygreen-ui/button@^21.0.5": + version "21.0.5" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/button/-/button-21.0.5.tgz#d398e1be10804163c6898b16805933f291528b86" + integrity sha512-6CdyTqzLoLCHCk4MV6SpMbtRizFXF224HZROWRskIdh1v1fglqEKsTU39VWW+dsgagXc33FyMHDWNbmpWb0Jlw== + dependencies: + "@leafygreen-ui/box" "^3.1.8" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/ripple" "^1.1.12" + "@leafygreen-ui/tokens" "^2.1.4" + polished "^4.2.2" + "@leafygreen-ui/callout@9.0.13": version "9.0.13" resolved "https://registry.yarnpkg.com/@leafygreen-ui/callout/-/callout-9.0.13.tgz#968860a52915c3f3b00056d7952e8114f80e377f" @@ -3471,19 +3471,20 @@ lodash "^4.17.21" polished "^4.2.2" -"@leafygreen-ui/confirmation-modal@4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/confirmation-modal/-/confirmation-modal-4.0.3.tgz#a8581f8edd7a02618dc393280ec614510d092f4a" - integrity sha512-aEiWTlaafWc8xVhq84yYTr+/z4ITs9XaD0o3l6sRiSSXA9runeVznbb7brt/ZCeELk0OiqSG6OMOqI86pZFa5w== +"@leafygreen-ui/confirmation-modal@5.0.6": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/confirmation-modal/-/confirmation-modal-5.0.6.tgz#46f654a7123a8489cc7a98472331b50505a0bfb6" + integrity sha512-tH6sb1WRK+KR52p+g4UdQ/vB7Gfb7YDjIXH6R0k062TAFPYv0a2OC2B8btYo2wrKUDCudL7+oKVcLRndawzlzw== dependencies: - "@leafygreen-ui/button" "^19.0.4" - "@leafygreen-ui/emotion" "^4.0.3" - "@leafygreen-ui/icon" "^11.12.4" - "@leafygreen-ui/modal" "^14.0.1" - "@leafygreen-ui/palette" "^3.4.7" - "@leafygreen-ui/text-input" "^12.1.4" - "@leafygreen-ui/tokens" "^2.0.0" - "@leafygreen-ui/typography" "^16.0.0" + "@leafygreen-ui/button" "^21.0.5" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/icon" "^11.22.2" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/modal" "^16.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/text-input" "^12.1.21" + "@leafygreen-ui/tokens" "^2.1.4" + "@leafygreen-ui/typography" "^17.0.0" "@leafygreen-ui/emotion@4.0.3": version "4.0.3" @@ -3493,7 +3494,7 @@ "@emotion/css" "^11.1.3" "@emotion/server" "^11.4.0" -"@leafygreen-ui/emotion@^4.0.3", "@leafygreen-ui/emotion@^4.0.4", "@leafygreen-ui/emotion@^4.0.5", "@leafygreen-ui/emotion@^4.0.7": +"@leafygreen-ui/emotion@^4.0.3", "@leafygreen-ui/emotion@^4.0.4", "@leafygreen-ui/emotion@^4.0.7": version "4.0.7" resolved "https://registry.yarnpkg.com/@leafygreen-ui/emotion/-/emotion-4.0.7.tgz#035dceb7c9c71aa244e44dd66d25549aafb23541" integrity sha512-OxBgzEqmnZHxH9sAn6421zGKCgZ/nSf3Ryg/Ihvqz9NJEuPmKFMt/Kign4TeoaWZraIXAiWTt8q0QVBzu8ChVg== @@ -3536,7 +3537,7 @@ focus-trap-react "^10.0.0" polished "^4.2.2" -"@leafygreen-ui/hooks@^7.3.3", "@leafygreen-ui/hooks@^7.4.0", "@leafygreen-ui/hooks@^7.5.0", "@leafygreen-ui/hooks@^7.7.1", "@leafygreen-ui/hooks@^7.7.3", "@leafygreen-ui/hooks@^7.7.5", "@leafygreen-ui/hooks@^7.7.6", "@leafygreen-ui/hooks@^7.7.8": +"@leafygreen-ui/hooks@^7.3.3", "@leafygreen-ui/hooks@^7.4.0", "@leafygreen-ui/hooks@^7.5.0", "@leafygreen-ui/hooks@^7.7.1", "@leafygreen-ui/hooks@^7.7.3", "@leafygreen-ui/hooks@^7.7.5", "@leafygreen-ui/hooks@^7.7.8": version "7.7.8" resolved "https://registry.yarnpkg.com/@leafygreen-ui/hooks/-/hooks-7.7.8.tgz#63b884067711c42c152edc185b7a2e8be474c264" integrity sha512-8n0GjAxIxXN1e7XcZ2bobdI56XCqbtH3AZTbWTgQdILnTdxuA/9+yif1zIP4L8shoUbcosuMwU5HRu4UnX9n1g== @@ -3563,7 +3564,7 @@ "@leafygreen-ui/palette" "^3.4.7" "@leafygreen-ui/tokens" "^2.0.0" -"@leafygreen-ui/icon-button@^15.0.0", "@leafygreen-ui/icon-button@^15.0.1", "@leafygreen-ui/icon-button@^15.0.10", "@leafygreen-ui/icon-button@^15.0.12", "@leafygreen-ui/icon-button@^15.0.14", "@leafygreen-ui/icon-button@^15.0.16", "@leafygreen-ui/icon-button@^15.0.4", "@leafygreen-ui/icon-button@^15.0.7", "@leafygreen-ui/icon-button@^15.0.9": +"@leafygreen-ui/icon-button@^15.0.0", "@leafygreen-ui/icon-button@^15.0.1", "@leafygreen-ui/icon-button@^15.0.10", "@leafygreen-ui/icon-button@^15.0.12", "@leafygreen-ui/icon-button@^15.0.16", "@leafygreen-ui/icon-button@^15.0.4", "@leafygreen-ui/icon-button@^15.0.7": version "15.0.16" resolved "https://registry.yarnpkg.com/@leafygreen-ui/icon-button/-/icon-button-15.0.16.tgz#3e6d4b1433f72ecec416c43426a687234cb6096b" integrity sha512-j/y60X+At8tm1uKj2LWfppxuH3lCB1Mwa99PFhmVVD9ohNFjjqY6m5Vll7NTq10AelUimWOYk+uCzh4A96x4kQ== @@ -3596,7 +3597,7 @@ dependencies: "@leafygreen-ui/emotion" "^4.0.3" -"@leafygreen-ui/icon@^11.12.0", "@leafygreen-ui/icon@^11.12.1", "@leafygreen-ui/icon@^11.12.3", "@leafygreen-ui/icon@^11.12.4", "@leafygreen-ui/icon@^11.12.5", "@leafygreen-ui/icon@^11.13.1", "@leafygreen-ui/icon@^11.14.0", "@leafygreen-ui/icon@^11.15.0", "@leafygreen-ui/icon@^11.17.0", "@leafygreen-ui/icon@^11.18.0", "@leafygreen-ui/icon@^11.20.1", "@leafygreen-ui/icon@^11.22.1": +"@leafygreen-ui/icon@^11.12.0", "@leafygreen-ui/icon@^11.12.1", "@leafygreen-ui/icon@^11.12.3", "@leafygreen-ui/icon@^11.12.4", "@leafygreen-ui/icon@^11.12.5", "@leafygreen-ui/icon@^11.13.1", "@leafygreen-ui/icon@^11.14.0", "@leafygreen-ui/icon@^11.15.0", "@leafygreen-ui/icon@^11.17.0", "@leafygreen-ui/icon@^11.22.1": version "11.22.1" resolved "https://registry.yarnpkg.com/@leafygreen-ui/icon/-/icon-11.22.1.tgz#99359f771ef681703801d188a1280b6cb0cc2963" integrity sha512-ZwlLW4OuSkErJL1MFNUuIPeke48TKX2ikZPhEylbbt1YepbnXrpF9TgoNoe+eQCmWcRT5Uhw9M8MDCTUfNPGfg== @@ -3666,7 +3667,7 @@ "@leafygreen-ui/hooks" "^7.3.3" "@leafygreen-ui/lib" "^10.0.0" -"@leafygreen-ui/lib@^10.0.0", "@leafygreen-ui/lib@^10.1.0", "@leafygreen-ui/lib@^10.2.2", "@leafygreen-ui/lib@^10.3.2", "@leafygreen-ui/lib@^10.3.3", "@leafygreen-ui/lib@^10.4.0", "@leafygreen-ui/lib@^10.4.1", "@leafygreen-ui/lib@^10.4.3": +"@leafygreen-ui/lib@^10.0.0", "@leafygreen-ui/lib@^10.1.0", "@leafygreen-ui/lib@^10.2.2", "@leafygreen-ui/lib@^10.3.2", "@leafygreen-ui/lib@^10.3.3", "@leafygreen-ui/lib@^10.4.0", "@leafygreen-ui/lib@^10.4.3": version "10.4.3" resolved "https://registry.yarnpkg.com/@leafygreen-ui/lib/-/lib-10.4.3.tgz#f5ebdabc82922067adee8f37833237685bb1b1a8" integrity sha512-p5BtXHeQsvLnnrN0eunPFZeaMtW9z7Mbvm2WOS9lvnAySj8xZp5Vn9Y3XjyYLbPhpGVBhhOAJFP3YMxbP9DKgg== @@ -3696,18 +3697,18 @@ "@leafygreen-ui/typography" "^17.0.0" react-lottie-player "^1.5.4" -"@leafygreen-ui/marketing-modal@^4.0.5": - version "4.0.11" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/marketing-modal/-/marketing-modal-4.0.11.tgz#4d780792e7aa48a02634493276bac72b5b6d733a" - integrity sha512-VIece0VsFOENoDC6YT6Q6RF9jbDVeF07RS2oFt3rBFh2QiuXVlNIpsWLD10yxKcpvFM7JVLlVuKwSi8MUsmBHw== +"@leafygreen-ui/marketing-modal@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/marketing-modal/-/marketing-modal-4.1.0.tgz#64ae619fb52d220fb4a7f64f55f179c614256798" + integrity sha512-zav5OQiwG4AC1nRWIlDxX215YTKVcXAE0MS8ufpdsTQV2cpEQ+9mE7R6MZO1Z6YZXCVfNaqA2YcJ3yWCTgyjwA== dependencies: - "@leafygreen-ui/button" "^21.0.0" - "@leafygreen-ui/emotion" "^4.0.5" - "@leafygreen-ui/lib" "^10.4.1" - "@leafygreen-ui/modal" "^15.0.4" - "@leafygreen-ui/palette" "^4.0.5" - "@leafygreen-ui/tokens" "^2.1.2" - "@leafygreen-ui/typography" "^16.5.2" + "@leafygreen-ui/button" "^21.0.5" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/modal" "^16.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/tokens" "^2.1.4" + "@leafygreen-ui/typography" "^17.0.0" "@leafygreen-ui/menu@20.0.1": version "20.0.1" @@ -3726,60 +3727,24 @@ lodash "^4.17.21" react-transition-group "^4.4.1" -"@leafygreen-ui/modal@14.0.1": - version "14.0.1" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/modal/-/modal-14.0.1.tgz#c5f1520af1e3a56f6474e182383699cefa6266ac" - integrity sha512-up+9eYYYNzbM1ZsfO/yRrjetd+AA1jElxtNJXjgYhz1Ow6T1cv+JJqLayMw2g1Rf2/hugzRmFOmVCQqhucrxFQ== - dependencies: - "@leafygreen-ui/emotion" "^4.0.3" - "@leafygreen-ui/hooks" "^7.3.3" - "@leafygreen-ui/icon" "^11.12.4" - "@leafygreen-ui/icon-button" "^15.0.4" - "@leafygreen-ui/lib" "^10.0.0" - "@leafygreen-ui/palette" "^3.4.7" - "@leafygreen-ui/portal" "^4.0.9" - "@leafygreen-ui/tokens" "^2.0.0" - facepaint "^1.2.1" - focus-trap-react "^8.10.0" - polished "^4.2.2" - prop-types "^15.8.1" - react-transition-group "^4.4.1" - -"@leafygreen-ui/modal@^14.0.1": - version "14.0.5" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/modal/-/modal-14.0.5.tgz#ce5553411f273ed2262864bc17b0a3cb8b043631" - integrity sha512-7zrBZSdf4P8OWeUxxFRLgSZhh/V7REbkXJrpqb/JK2fclU161ZeT2SLLdFKfnjQqf4n3eOVrlDsxy8xwwZ769Q== +"@leafygreen-ui/modal@16.0.1", "@leafygreen-ui/modal@^16.0.0": + version "16.0.1" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/modal/-/modal-16.0.1.tgz#ce0a233c9efd814db9359e605aed5ec204b7becc" + integrity sha512-sdHr+u8DFwZBG7MIA2rQnYy1FcOWqREivpFJpLoXrqDEjpqxfdXDCTLtT0U+OTtOL4f9LHmu+9/j0d3YWHNxJA== dependencies: - "@leafygreen-ui/emotion" "^4.0.4" - "@leafygreen-ui/hooks" "^7.7.1" - "@leafygreen-ui/icon" "^11.13.1" - "@leafygreen-ui/icon-button" "^15.0.9" - "@leafygreen-ui/lib" "^10.3.2" - "@leafygreen-ui/palette" "^4.0.3" - "@leafygreen-ui/portal" "^4.1.1" - "@leafygreen-ui/tokens" "^2.0.2" - focus-trap-react "^8.10.0" - polished "^4.2.2" - prop-types "^15.8.1" - react-transition-group "^4.4.1" - -"@leafygreen-ui/modal@^15.0.4": - version "15.0.4" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/modal/-/modal-15.0.4.tgz#8108bfd99a9e5cfe980565a195947d22f11197b5" - integrity sha512-lr3oXLdGva4xcbd3rujAkyXAiZx93vAjb4lXJsTe/bVyyomFek23th3ZbCd4IkSsLvKKA0w/fM0qIl103lJAqQ== - dependencies: - "@leafygreen-ui/emotion" "^4.0.5" - "@leafygreen-ui/hooks" "^7.7.6" - "@leafygreen-ui/icon" "^11.20.1" - "@leafygreen-ui/icon-button" "^15.0.14" - "@leafygreen-ui/lib" "^10.4.1" - "@leafygreen-ui/palette" "^4.0.5" - "@leafygreen-ui/portal" "^4.1.5" - "@leafygreen-ui/tokens" "^2.1.2" - focus-trap-react "^8.10.0" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/hooks" "^8.0.0" + "@leafygreen-ui/icon" "^11.23.0" + "@leafygreen-ui/icon-button" "^15.0.17" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/portal" "^5.0.1" + "@leafygreen-ui/tokens" "^2.2.0" + focus-trap "6.9.4" + focus-trap-react "^9.0.2" polished "^4.2.2" prop-types "^15.8.1" - react-transition-group "^4.4.1" + react-transition-group "^4.4.5" "@leafygreen-ui/number-input@1.0.4": version "1.0.4" @@ -3815,7 +3780,7 @@ "@leafygreen-ui/typography" "^16.5.4" lodash "^4.17.21" -"@leafygreen-ui/palette@4.0.7", "@leafygreen-ui/palette@^4.0.0", "@leafygreen-ui/palette@^4.0.3", "@leafygreen-ui/palette@^4.0.4", "@leafygreen-ui/palette@^4.0.5", "@leafygreen-ui/palette@^4.0.7": +"@leafygreen-ui/palette@4.0.7", "@leafygreen-ui/palette@^4.0.0", "@leafygreen-ui/palette@^4.0.3", "@leafygreen-ui/palette@^4.0.4", "@leafygreen-ui/palette@^4.0.7": version "4.0.7" resolved "https://registry.yarnpkg.com/@leafygreen-ui/palette/-/palette-4.0.7.tgz#1739d29411b8ba02a2be756e198f10c242428bb0" integrity sha512-rBeAk4Tk3t9pYqXYKqVZfma/MH1SBtt02BxAL6TpJb8wQ+i5zap6o1Gnb3nF9LAG7sA0+OHfr1B5uSvr63GGqw== @@ -3876,7 +3841,7 @@ "@leafygreen-ui/tokens" "^2.1.4" react-transition-group "^4.4.1" -"@leafygreen-ui/portal@^4.0.7", "@leafygreen-ui/portal@^4.0.9", "@leafygreen-ui/portal@^4.1.1", "@leafygreen-ui/portal@^4.1.2", "@leafygreen-ui/portal@^4.1.4": +"@leafygreen-ui/portal@^4.0.7", "@leafygreen-ui/portal@^4.0.9", "@leafygreen-ui/portal@^4.1.2", "@leafygreen-ui/portal@^4.1.4": version "4.1.4" resolved "https://registry.yarnpkg.com/@leafygreen-ui/portal/-/portal-4.1.4.tgz#31513ce87c8619cdfa514900cac5f4bb882d28e5" integrity sha512-gtzQno7yXGmbblHIVBWpJ6+TIFwep/PL4M6vcloCzAaV88+gSMJ9lhrBJbqYQkfd65xeEaycClDsfCpI35p/nA== @@ -3884,14 +3849,6 @@ "@leafygreen-ui/hooks" "^7.7.5" "@leafygreen-ui/lib" "^10.4.0" -"@leafygreen-ui/portal@^4.1.5": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/portal/-/portal-4.1.5.tgz#27543fc312ea756c69203c78c05f87deb5039073" - integrity sha512-PMSJFGO18ziv33w0aFGvqZ2mjeMArC2YxfQJit2ocfJ5fmVpa80Iw7sYeSNjns8tAanxQNTZaoOsSzFuWUw7Qw== - dependencies: - "@leafygreen-ui/hooks" "^7.7.6" - "@leafygreen-ui/lib" "^10.4.1" - "@leafygreen-ui/portal@^4.1.7": version "4.1.7" resolved "https://registry.yarnpkg.com/@leafygreen-ui/portal/-/portal-4.1.7.tgz#eb8a7352f5423a7bdebe419b1248e98c5540b8f6" @@ -3900,6 +3857,14 @@ "@leafygreen-ui/hooks" "^7.7.8" "@leafygreen-ui/lib" "^10.4.3" +"@leafygreen-ui/portal@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/portal/-/portal-5.0.1.tgz#a5b6962210bca1809cd2dc67ae4c767e755a0f34" + integrity sha512-SL+Kw2088aopilmzKOTfzWE4tVKyRyClr1nnOaX+xplQ+6gu22C+LDFL4cJZkkWyP8WlqAE+2s1C631W3uHbPg== + dependencies: + "@leafygreen-ui/hooks" "^8.0.0" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/radio-box-group@12.0.1": version "12.0.1" resolved "https://registry.yarnpkg.com/@leafygreen-ui/radio-box-group/-/radio-box-group-12.0.1.tgz#64f44ad30d99958ccc18e2303269175c4cad715d" @@ -4108,18 +4073,18 @@ "@leafygreen-ui/tokens" "^1.4.0" "@leafygreen-ui/typography" "^15.1.0" -"@leafygreen-ui/text-input@^12.1.4": - version "12.1.15" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/text-input/-/text-input-12.1.15.tgz#745cecc39dd855278b7e8d075356dcca3e4d4e8a" - integrity sha512-G9hRfALWKI/0jfR/wj0Vf8TLH+xrtr/cCTZoPeTfZYXWjKiQ+i1zOAWe+jCxFrg4t0eY6fAAVFfPrH4WAjpQTQ== +"@leafygreen-ui/text-input@^12.1.21": + version "12.1.21" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/text-input/-/text-input-12.1.21.tgz#a07bfe6e393194fb1043777566508cc6e325cfae" + integrity sha512-Ar/eyyLrEdbqXgJ81CVxoc4flkI3JjiADiAAWBZgfYym9aifhDItOl1RfaqmGAS3oAMRD5eF99Lcaqa+7jQEBw== dependencies: - "@leafygreen-ui/emotion" "^4.0.4" - "@leafygreen-ui/hooks" "^7.7.5" - "@leafygreen-ui/icon" "^11.18.0" - "@leafygreen-ui/lib" "^10.4.0" - "@leafygreen-ui/palette" "^4.0.4" - "@leafygreen-ui/tokens" "^2.1.1" - "@leafygreen-ui/typography" "^16.5.1" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/hooks" "^8.0.0" + "@leafygreen-ui/icon" "^11.23.0" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/tokens" "^2.2.0" + "@leafygreen-ui/typography" "^17.0.0" "@leafygreen-ui/toast@6.1.4": version "6.1.4" @@ -4165,7 +4130,7 @@ dependencies: "@leafygreen-ui/palette" "^3.4.5" -"@leafygreen-ui/tokens@^2.0.0", "@leafygreen-ui/tokens@^2.0.1", "@leafygreen-ui/tokens@^2.0.2", "@leafygreen-ui/tokens@^2.0.3", "@leafygreen-ui/tokens@^2.1.0", "@leafygreen-ui/tokens@^2.1.1", "@leafygreen-ui/tokens@^2.1.2", "@leafygreen-ui/tokens@^2.1.4": +"@leafygreen-ui/tokens@^2.0.0", "@leafygreen-ui/tokens@^2.0.1", "@leafygreen-ui/tokens@^2.0.2", "@leafygreen-ui/tokens@^2.0.3", "@leafygreen-ui/tokens@^2.1.0", "@leafygreen-ui/tokens@^2.1.1", "@leafygreen-ui/tokens@^2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@leafygreen-ui/tokens/-/tokens-2.1.4.tgz#0581bd7de718962305de134865182944e038f863" integrity sha512-cP3FYPswaG99+gt/b9ISUQc2920C1qeFTKiguKZUftIPS8PBMkCHAGNbBpJJYU3VO46ISs2BHtOiztBf5spKQA== @@ -4251,7 +4216,7 @@ "@leafygreen-ui/palette" "^3.4.6" "@leafygreen-ui/tokens" "^1.4.1" -"@leafygreen-ui/typography@^16.0.0", "@leafygreen-ui/typography@^16.1.0", "@leafygreen-ui/typography@^16.2.1", "@leafygreen-ui/typography@^16.3.0", "@leafygreen-ui/typography@^16.4.0", "@leafygreen-ui/typography@^16.5.1", "@leafygreen-ui/typography@^16.5.2", "@leafygreen-ui/typography@^16.5.4": +"@leafygreen-ui/typography@^16.0.0", "@leafygreen-ui/typography@^16.1.0", "@leafygreen-ui/typography@^16.2.1", "@leafygreen-ui/typography@^16.3.0", "@leafygreen-ui/typography@^16.4.0", "@leafygreen-ui/typography@^16.5.1", "@leafygreen-ui/typography@^16.5.4": version "16.5.4" resolved "https://registry.yarnpkg.com/@leafygreen-ui/typography/-/typography-16.5.4.tgz#209839039b97be7c9eabddec85729eb8685abfc9" integrity sha512-E9U8HD3AfeMMr0ZLkrSz8FUagxGSAqPb+DqASmJAdax4h82EXLJGBDmePQr4C+AVCx1pb5UZrckr67eBHCalnA== @@ -9787,14 +9752,15 @@ focus-trap-react@^10.0.0: focus-trap "^7.5.2" tabbable "^6.2.0" -focus-trap-react@^8.10.0: - version "8.11.3" - resolved "https://registry.yarnpkg.com/focus-trap-react/-/focus-trap-react-8.11.3.tgz#aa0ba3b17676abf8faf78c5e51d8cd8df83eec41" - integrity sha512-y126gMYuB1aVYiEZSP6/v9bAfVmAIUVixanhcoMelkz7bOh+l0c3h05CEHC8S63ztxdRI2AAPS9AsTat6jlDeQ== +focus-trap-react@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/focus-trap-react/-/focus-trap-react-9.0.2.tgz#5ed03f7653c9be62a39f75bfeae88c21c8505ef0" + integrity sha512-ZwhO5by6KG5r3dy48Lk00A1/0zNYw1Z3RZTN6O6kgAPsWFcwTFszOcQ1dLSfM8pIxpS/ttc7wTttJowjVT3jpg== dependencies: focus-trap "^6.9.4" + tabbable "^5.3.3" -focus-trap@^6.9.4: +focus-trap@6.9.4, focus-trap@^6.9.4: version "6.9.4" resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-6.9.4.tgz#436da1a1d935c48b97da63cd8f361c6f3aa16444" integrity sha512-v2NTsZe2FF59Y+sDykKY+XjqZ0cPfhq/hikWVL88BqLivnNiEffAsac6rP6H45ff9wG9LL5ToiDqrLEP9GX9mw== From 28cf1e7e5338ffe62eee5eef3e3ff83807fceff3 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Thu, 14 Sep 2023 16:05:16 -0400 Subject: [PATCH 2/5] Fix cypress test --- cypress/integration/version/name_change_modal.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cypress/integration/version/name_change_modal.ts b/cypress/integration/version/name_change_modal.ts index 25556ca35f..5e4f78866a 100644 --- a/cypress/integration/version/name_change_modal.ts +++ b/cypress/integration/version/name_change_modal.ts @@ -27,17 +27,25 @@ describe("Name change modal", () => { it("The confirm button is disabled when the text area value is empty or greater than 300 characters", () => { cy.dataCy("name-change-modal-trigger").click(); cy.get("textarea").clear(); - cy.contains("button", "Confirm").should("have.attr", "aria-disabled", true); + cy.contains("button", "Confirm").should( + "have.attr", + "aria-disabled", + "true" + ); cy.get("textarea").type("lol"); cy.contains("button", "Confirm").should( "have.attr", "aria-disabled", - false + "false" ); const over300Chars = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; cy.get("textarea").type(over300Chars); - cy.contains("button", "Confirm").should("have.attr", "aria-disabled", true); + cy.contains("button", "Confirm").should( + "have.attr", + "aria-disabled", + "true" + ); cy.contains("Value cannot exceed 300 characters"); }); }); From 6f32c74872ac4bb4aeb51f2abe916dcc1331e0fd Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Thu, 14 Sep 2023 21:42:30 -0400 Subject: [PATCH 3/5] Mock tabbable --- __mocks__/tabbable.js | 16 ++++++++++++++++ src/components/WelcomeModal/WelcomeModal.tsx | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 __mocks__/tabbable.js diff --git a/__mocks__/tabbable.js b/__mocks__/tabbable.js new file mode 100644 index 0000000000..d968824eb4 --- /dev/null +++ b/__mocks__/tabbable.js @@ -0,0 +1,16 @@ +// https://github.com/focus-trap/tabbable#testing-in-jsdom +const lib = jest.requireActual("tabbable"); + +const tabbable = { + ...lib, + tabbable: (node, options) => + lib.tabbable(node, { ...options, displayCheck: "none" }), + focusable: (node, options) => + lib.focusable(node, { ...options, displayCheck: "none" }), + isFocusable: (node, options) => + lib.isFocusable(node, { ...options, displayCheck: "none" }), + isTabbable: (node, options) => + lib.isTabbable(node, { ...options, displayCheck: "none" }), +}; + +module.exports = tabbable; diff --git a/src/components/WelcomeModal/WelcomeModal.tsx b/src/components/WelcomeModal/WelcomeModal.tsx index eea557e6af..6a095dcd88 100644 --- a/src/components/WelcomeModal/WelcomeModal.tsx +++ b/src/components/WelcomeModal/WelcomeModal.tsx @@ -78,7 +78,6 @@ const WelcomeModal: React.FC = ({ z-index: ${zIndex.max_do_not_use}; `} size="large" - initialFocus=".slick-active" > {title && {title}} Date: Fri, 15 Sep 2023 11:10:29 -0400 Subject: [PATCH 4/5] Remove unused dep --- package.json | 1 - yarn.lock | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/package.json b/package.json index 6bd4266b19..b6bab5ca4c 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,6 @@ "@leafygreen-ui/interaction-ring": "7.0.2", "@leafygreen-ui/leafygreen-provider": "3.1.0", "@leafygreen-ui/loading-indicator": "2.0.5", - "@leafygreen-ui/marketing-modal": "^4.1.0", "@leafygreen-ui/menu": "20.0.1", "@leafygreen-ui/modal": "16.0.1", "@leafygreen-ui/number-input": "1.0.4", diff --git a/yarn.lock b/yarn.lock index 3fe07c7b12..97e4466c61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3697,19 +3697,6 @@ "@leafygreen-ui/typography" "^17.0.0" react-lottie-player "^1.5.4" -"@leafygreen-ui/marketing-modal@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@leafygreen-ui/marketing-modal/-/marketing-modal-4.1.0.tgz#64ae619fb52d220fb4a7f64f55f179c614256798" - integrity sha512-zav5OQiwG4AC1nRWIlDxX215YTKVcXAE0MS8ufpdsTQV2cpEQ+9mE7R6MZO1Z6YZXCVfNaqA2YcJ3yWCTgyjwA== - dependencies: - "@leafygreen-ui/button" "^21.0.5" - "@leafygreen-ui/emotion" "^4.0.7" - "@leafygreen-ui/lib" "^11.0.0" - "@leafygreen-ui/modal" "^16.0.0" - "@leafygreen-ui/palette" "^4.0.7" - "@leafygreen-ui/tokens" "^2.1.4" - "@leafygreen-ui/typography" "^17.0.0" - "@leafygreen-ui/menu@20.0.1": version "20.0.1" resolved "https://registry.yarnpkg.com/@leafygreen-ui/menu/-/menu-20.0.1.tgz#73384d4a49c5268a31cf09ff4355a5022de3319e" From f6c76ec8b49f9c0f361e27ae400877e509a3b368 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 15 Sep 2023 11:11:16 -0400 Subject: [PATCH 5/5] move focus-trap-react mock --- __mocks__/focus-trap-react.js | 7 +++++++ config/jest/setupTests.ts | 12 ------------ 2 files changed, 7 insertions(+), 12 deletions(-) create mode 100644 __mocks__/focus-trap-react.js diff --git a/__mocks__/focus-trap-react.js b/__mocks__/focus-trap-react.js new file mode 100644 index 0000000000..0069bcfea7 --- /dev/null +++ b/__mocks__/focus-trap-react.js @@ -0,0 +1,7 @@ +// Mock focus-trap-react to prevent errors in tests that use modals. focus-trap-react is a package used +// by LeafyGreen and is not a direct dependency of Spruce. +const lib = jest.requireActual("focus-trap-react"); + +lib.prototype.setupFocusTrap = () => null; + +module.exports = lib; diff --git a/config/jest/setupTests.ts b/config/jest/setupTests.ts index 712d9679d3..ca1c3dc481 100644 --- a/config/jest/setupTests.ts +++ b/config/jest/setupTests.ts @@ -17,15 +17,3 @@ window.crypto.randomUUID = (() => { }; })(); -// Mock focus-trap-react to prevent errors in tests that use modals. focus-trap-react is a package used -// by LeafyGreen and is not a direct dependency of Spruce. -jest.mock( - "focus-trap-react", - () => { - const focusTrap = jest.requireActual( - "focus-trap-react" - ); - focusTrap.prototype.setupFocusTrap = () => null; - return focusTrap; - } -);