Browse Source

feat(dashboard-layout): Add types for react-grid-layout (#30201)

Nar Saynorath 3 years ago
parent
commit
f4dabe39bb
3 changed files with 9 additions and 1 deletions
  1. 1 0
      package.json
  2. 1 1
      static/app/views/dashboardsV2/gridLayout/dashboard.tsx
  3. 7 0
      yarn.lock

+ 1 - 0
package.json

@@ -51,6 +51,7 @@
     "@types/react-date-range": "^1.1.5",
     "@types/react-document-title": "^2.0.5",
     "@types/react-dom": "~17.0.9",
+    "@types/react-grid-layout": "^1.3.0",
     "@types/react-mentions": "4.1.2",
     "@types/react-router": "^3.0.22",
     "@types/react-select": "3.0.8",

+ 1 - 1
static/app/views/dashboardsV2/gridLayout/dashboard.tsx

@@ -34,7 +34,7 @@ import SortableWidget from './sortableWidget';
 export const DRAG_HANDLE_CLASS = 'widget-drag';
 const NUM_COLS = 6;
 const ROW_HEIGHT = 120;
-const WIDGET_MARGINS = [16, 16];
+const WIDGET_MARGINS: [number, number] = [16, 16];
 const ADD_BUTTON_POSITION = {
   x: 0,
   y: Number.MAX_VALUE,

+ 7 - 0
yarn.lock

@@ -3475,6 +3475,13 @@
   dependencies:
     "@types/react" "*"
 
+"@types/react-grid-layout@^1.3.0":
+  version "1.3.0"
+  resolved "https://registry.yarnpkg.com/@types/react-grid-layout/-/react-grid-layout-1.3.0.tgz#aa00b2b8de350aa7f6c570e69d7a0daf571de24c"
+  integrity sha512-Pytm7lvm4h91yN9CpdjV8IpU/hgVRHrUhDEIX593e4Mx9V14Pr3gWtj21WHzy5bDqU//jnGGVVSYJ3QVuI1NaQ==
+  dependencies:
+    "@types/react" "*"
+
 "@types/react-mentions@4.1.2":
   version "4.1.2"
   resolved "https://registry.yarnpkg.com/@types/react-mentions/-/react-mentions-4.1.2.tgz#00d29feb42ec69566495efb8a6ea08b443ef8af8"