Browse Source

feat(deps): update atlaskit/tabs to 8.0.8

There are (at least) two changes that are breaking:
- defaultTab is gone
- The re-rendering logic looks to have been re-written so that
  passing in a new array of tabs causes a re-render, which can
  reset the currently selected tab.

The fixes involved removing defaultTab from each tab configuration,
as it is no longer respected anyway. Also, instead of letting Tabs
be uncontrolled and allowing it to set its own selected, which
would result in the first tab automatically being selected on
Tabs re-render, use Tabs a controlled prop to dicate which
tab is selected; this is accomplished by specifying a selected
prop.
master
Leonard Kim 7 years ago
parent
commit
7c88de20fe

+ 6
- 6
css/_atlaskit_overrides.scss View File

18
     /**
18
     /**
19
      * The text color of the selected tab and hovered tabs.
19
      * The text color of the selected tab and hovered tabs.
20
      */
20
      */
21
-    li.bcVmZW,
22
-    li.bcVmZW:hover,
23
-    li.kheoEp:hover {
21
+    .bVobOt,
22
+    .bVobOt:hover,
23
+    .ebveIl:hover {
24
         color: #172B4D;
24
         color: #172B4D;
25
     }
25
     }
26
 
26
 
27
     /**
27
     /**
28
      * The color of the inactive tab text.
28
      * The color of the inactive tab text.
29
      */
29
      */
30
-    li.kheoEp {
30
+    .ebveIl {
31
         color: #FFFFFF;
31
         color: #FFFFFF;
32
     }
32
     }
33
 
33
 
34
     /**
34
     /**
35
      * The color of the underline of a selected tab.
35
      * The color of the underline of a selected tab.
36
      */
36
      */
37
-    li>span.kByArU {
37
+    .kByArU {
38
         background-color: #172B4D;
38
         background-color: #172B4D;
39
     }
39
     }
40
 }
40
 }
54
     .gBLqhw[data-role=droplistContent] {
54
     .gBLqhw[data-role=droplistContent] {
55
         border: 1px solid #455166;
55
         border: 1px solid #455166;
56
     }
56
     }
57
-}
57
+}

+ 9
- 30
package-lock.json View File

420
       }
420
       }
421
     },
421
     },
422
     "@atlaskit/tabs": {
422
     "@atlaskit/tabs": {
423
-      "version": "4.0.1",
424
-      "resolved": "https://registry.npmjs.org/@atlaskit/tabs/-/tabs-4.0.1.tgz",
425
-      "integrity": "sha1-vM2WQ8nSO9kR+0GCK4U1oYJHHM8=",
423
+      "version": "8.0.8",
424
+      "resolved": "https://registry.npmjs.org/@atlaskit/tabs/-/tabs-8.0.8.tgz",
425
+      "integrity": "sha512-zNzF/vwazWWrSHLLleIVzuRszALy9xRN7jAaS/u1aaJwrGF5exYbtQ4RZQ9Bx46d7p4HLx3mb+/74GmR6yJ6Gw==",
426
       "requires": {
426
       "requires": {
427
-        "@atlaskit/theme": "^2.0.0",
428
-        "@atlaskit/util-shared-styles": "^1.0.0",
427
+        "@atlaskit/analytics-next": "^3.0.6",
428
+        "@atlaskit/theme": "^6.0.2",
429
         "classnames": "^2.2.5",
429
         "classnames": "^2.2.5",
430
         "css-element-queries": "^0.3.2",
430
         "css-element-queries": "^0.3.2",
431
         "debounce": "^1.0.0",
431
         "debounce": "^1.0.0",
432
-        "keycode": "^2.1.4",
433
-        "prop-types": "^15.5.10",
434
-        "styled-components": "^1.3.0"
435
-      },
436
-      "dependencies": {
437
-        "@atlaskit/theme": {
438
-          "version": "2.4.1",
439
-          "resolved": "http://registry.npmjs.org/@atlaskit/theme/-/theme-2.4.1.tgz",
440
-          "integrity": "sha512-I4AMg+asUUwaruwsWDaUzub2zhEKYHhZ5tRlaNQ+8dhATpO1RSu6g9FSgwnAZ20M4Cf+YITVND/wyNpAON5HCQ==",
441
-          "requires": {
442
-            "prop-types": "^15.5.10",
443
-            "styled-components": "1.4.6 - 3"
444
-          }
445
-        },
446
-        "@atlaskit/util-shared-styles": {
447
-          "version": "1.7.1",
448
-          "resolved": "https://registry.npmjs.org/@atlaskit/util-shared-styles/-/util-shared-styles-1.7.1.tgz",
449
-          "integrity": "sha1-CDLLbMF5dDHEzPZ9F4qkES3zBeI=",
450
-          "requires": {
451
-            "babel-runtime": "^6.11.6"
452
-          }
453
-        }
432
+        "keycode": "^2.1.7"
454
       }
433
       }
455
     },
434
     },
456
     "@atlaskit/tag": {
435
     "@atlaskit/tag": {
5229
       "dev": true
5208
       "dev": true
5230
     },
5209
     },
5231
     "debounce": {
5210
     "debounce": {
5232
-      "version": "1.1.0",
5233
-      "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.1.0.tgz",
5234
-      "integrity": "sha512-ZQVKfRVlwRfD150ndzEK8M90ABT+Y/JQKs4Y7U4MXdpuoUkkrr4DwKbVux3YjylA5bUMUj0Nc3pMxPJX6N2QQQ=="
5211
+      "version": "1.2.0",
5212
+      "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz",
5213
+      "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg=="
5235
     },
5214
     },
5236
     "debug": {
5215
     "debug": {
5237
       "version": "2.6.9",
5216
       "version": "2.6.9",

+ 1
- 1
package.json View File

30
     "@atlaskit/modal-dialog": "6.0.12",
30
     "@atlaskit/modal-dialog": "6.0.12",
31
     "@atlaskit/multi-select": "11.0.6",
31
     "@atlaskit/multi-select": "11.0.6",
32
     "@atlaskit/spinner": "9.0.8",
32
     "@atlaskit/spinner": "9.0.8",
33
-    "@atlaskit/tabs": "4.0.1",
33
+    "@atlaskit/tabs": "8.0.8",
34
     "@atlaskit/theme": "6.0.2",
34
     "@atlaskit/theme": "6.0.2",
35
     "@atlaskit/tooltip": "12.0.14",
35
     "@atlaskit/tooltip": "12.0.14",
36
     "@microsoft/microsoft-graph-client": "1.1.0",
36
     "@microsoft/microsoft-graph-client": "1.1.0",

+ 26
- 2
react/features/base/dialog/components/DialogWithTabs.web.js View File

53
  */
53
  */
54
 type State = {
54
 type State = {
55
 
55
 
56
+    /**
57
+     * The index of the tab that should be displayed.
58
+     */
59
+    selectedTab: number,
60
+
56
     /**
61
     /**
57
      * An array of the states of the tabs.
62
      * An array of the states of the tabs.
58
      */
63
      */
74
     constructor(props: Props) {
79
     constructor(props: Props) {
75
         super(props);
80
         super(props);
76
         this.state = {
81
         this.state = {
82
+            selectedTab: this.props.defaultTab || 0,
77
             tabStates: this.props.tabs.map(tab => tab.props)
83
             tabStates: this.props.tabs.map(tab => tab.props)
78
         };
84
         };
79
         this._onSubmit = this._onSubmit.bind(this);
85
         this._onSubmit = this._onSubmit.bind(this);
86
+        this._onTabSelected = this._onTabSelected.bind(this);
80
         this._onTabStateChange = this._onTabStateChange.bind(this);
87
         this._onTabStateChange = this._onTabStateChange.bind(this);
81
     }
88
     }
82
 
89
 
125
         return { ...currentTabState };
132
         return { ...currentTabState };
126
     }
133
     }
127
 
134
 
135
+    _onTabSelected: (Object, number) => void;
136
+
137
+    /**
138
+     * Callback invoked when the desired tab to display should be changed.
139
+     *
140
+     * @param {Object} tab - The configuration passed into atlaskit tabs to
141
+     * describe how to display the selected tab.
142
+     * @param {number} tabIndex - The index of the tab within the array of
143
+     * displayed tabs.
144
+     * @private
145
+     * @returns {void}
146
+     */
147
+    _onTabSelected(tab, tabIndex) { // eslint-disable-line no-unused-vars
148
+        this.setState({ selectedTab: tabIndex });
149
+    }
150
+
128
     /**
151
     /**
129
      * Renders the tabs from the tab information passed on props.
152
      * Renders the tabs from the tab information passed on props.
130
      *
153
      *
131
      * @returns {void}
154
      * @returns {void}
132
      */
155
      */
133
     _renderTabs() {
156
     _renderTabs() {
134
-        const { defaultTab = 0, t, tabs } = this.props;
157
+        const { t, tabs } = this.props;
135
 
158
 
136
         if (tabs.length === 1) {
159
         if (tabs.length === 1) {
137
             return this._renderTab({
160
             return this._renderTab({
143
         if (tabs.length > 1) {
166
         if (tabs.length > 1) {
144
             return (
167
             return (
145
                 <Tabs
168
                 <Tabs
169
+                    onSelect = { this._onTabSelected }
170
+                    selected = { this.state.selectedTab }
146
                     tabs = {
171
                     tabs = {
147
                         tabs.map(({ component, label, styles }, idx) => {
172
                         tabs.map(({ component, label, styles }, idx) => {
148
                             return {
173
                             return {
151
                                     styles,
176
                                     styles,
152
                                     tabId: idx
177
                                     tabId: idx
153
                                 }),
178
                                 }),
154
-                                defaultSelected: defaultTab === idx,
155
                                 label: t(label)
179
                                 label: t(label)
156
                             };
180
                             };
157
                         })
181
                         })

+ 10
- 5
react/features/desktop-picker/components/DesktopPicker.js View File

81
 
81
 
82
     state = {
82
     state = {
83
         selectedSource: {},
83
         selectedSource: {},
84
+        selectedTab: 0,
84
         sources: {},
85
         sources: {},
85
         types: []
86
         types: []
86
     };
87
     };
283
      * Stores the selected tab and updates the selected source via
284
      * Stores the selected tab and updates the selected source via
284
      * {@code _getSelectedSource}.
285
      * {@code _getSelectedSource}.
285
      *
286
      *
286
-     * @param {int} idx - The index of the selected tab.
287
+     * @param {Object} tab - The configuration passed into atlaskit tabs to
288
+     * describe how to display the selected tab.
289
+     * @param {number} tabIndex - The index of the tab within the array of
290
+     * displayed tabs.
287
      * @returns {void}
291
      * @returns {void}
288
      */
292
      */
289
-    _onTabSelected(idx) {
293
+    _onTabSelected(tab, tabIndex) { // eslint-disable-line no-unused-vars
290
         const { types, sources } = this.state;
294
         const { types, sources } = this.state;
291
 
295
 
292
-        this._selectedTabType = types[idx];
296
+        this._selectedTabType = types[tabIndex];
293
         this.setState({
297
         this.setState({
294
-            selectedSource: this._getSelectedSource(sources)
298
+            selectedSource: this._getSelectedSource(sources),
299
+            selectedTab: tabIndex
295
         });
300
         });
296
     }
301
     }
297
 
302
 
315
                             selectedSourceId = { selectedSource.id }
320
                             selectedSourceId = { selectedSource.id }
316
                             sources = { sources[type] }
321
                             sources = { sources[type] }
317
                             type = { type } />,
322
                             type = { type } />,
318
-                        defaultSelected: type === DEFAULT_TAB_TYPE,
319
                         label: t(TAB_LABELS[type])
323
                         label: t(TAB_LABELS[type])
320
                     };
324
                     };
321
                 });
325
                 });
323
         return (
327
         return (
324
             <Tabs
328
             <Tabs
325
                 onSelect = { this._onTabSelected }
329
                 onSelect = { this._onTabSelected }
330
+                selected = { this.state.selectedTab }
326
                 tabs = { tabs } />);
331
                 tabs = { tabs } />);
327
     }
332
     }
328
 
333
 

+ 6
- 4
react/features/device-selection/components/AudioInputPreview.js View File

1
 import PropTypes from 'prop-types';
1
 import PropTypes from 'prop-types';
2
-import React, { PureComponent } from 'react';
2
+import React, { Component } from 'react';
3
 
3
 
4
 import { JitsiTrackEvents } from '../../base/lib-jitsi-meet';
4
 import { JitsiTrackEvents } from '../../base/lib-jitsi-meet';
5
 
5
 
6
 /**
6
 /**
7
  * React component for displaying a audio level meter for a JitsiLocalTrack.
7
  * React component for displaying a audio level meter for a JitsiLocalTrack.
8
  */
8
  */
9
-class AudioInputPreview extends PureComponent {
9
+class AudioInputPreview extends Component {
10
     /**
10
     /**
11
      * AudioInputPreview component's property types.
11
      * AudioInputPreview component's property types.
12
      *
12
      *
53
      * @returns {void}
53
      * @returns {void}
54
      */
54
      */
55
     componentWillReceiveProps(nextProps) {
55
     componentWillReceiveProps(nextProps) {
56
-        this._listenForAudioUpdates(nextProps.track);
57
-        this._updateAudioLevel(0);
56
+        if (nextProps.track !== this.props.track) {
57
+            this._listenForAudioUpdates(nextProps.track);
58
+            this._updateAudioLevel(0);
59
+        }
58
     }
60
     }
59
 
61
 
60
     /**
62
     /**

+ 22
- 4
react/features/welcome/components/WelcomePage.web.js View File

43
             ...this.state,
43
             ...this.state,
44
 
44
 
45
             generateRoomnames:
45
             generateRoomnames:
46
-                interfaceConfig.GENERATE_ROOMNAMES_ON_WELCOME_PAGE
46
+                interfaceConfig.GENERATE_ROOMNAMES_ON_WELCOME_PAGE,
47
+            selectedTab: 0
47
         };
48
         };
48
 
49
 
49
         /**
50
         /**
70
         this._onRoomChange = this._onRoomChange.bind(this);
71
         this._onRoomChange = this._onRoomChange.bind(this);
71
         this._setAdditionalContentRef
72
         this._setAdditionalContentRef
72
             = this._setAdditionalContentRef.bind(this);
73
             = this._setAdditionalContentRef.bind(this);
74
+        this._onTabSelected = this._onTabSelected.bind(this);
73
     }
75
     }
74
 
76
 
75
     /**
77
     /**
198
         super._onRoomChange(event.target.value);
200
         super._onRoomChange(event.target.value);
199
     }
201
     }
200
 
202
 
203
+    /**
204
+     * Callback invoked when the desired tab to display should be changed.
205
+     *
206
+     * @param {Object} tab - The configuration passed into atlaskit tabs to
207
+     * describe how to display the selected tab.
208
+     * @param {number} tabIndex - The index of the tab within the array of
209
+     * displayed tabs.
210
+     * @private
211
+     * @returns {void}
212
+     */
213
+    _onTabSelected(tab, tabIndex) { // eslint-disable-line no-unused-vars
214
+        this.setState({ selectedTab: tabIndex });
215
+    }
216
+
201
     /**
217
     /**
202
      * Renders tabs to show previous meetings and upcoming calendar events. The
218
      * Renders tabs to show previous meetings and upcoming calendar events. The
203
      * tabs are purposefully hidden on mobile browsers.
219
      * tabs are purposefully hidden on mobile browsers.
219
         if (CalendarList) {
235
         if (CalendarList) {
220
             tabs.push({
236
             tabs.push({
221
                 label: t('welcomepage.calendar'),
237
                 label: t('welcomepage.calendar'),
222
-                content: <CalendarList />,
223
-                defaultSelected: true
238
+                content: <CalendarList />
224
             });
239
             });
225
         }
240
         }
226
 
241
 
235
                 <div className = 'welcome-page-settings'>
250
                 <div className = 'welcome-page-settings'>
236
                     <SettingsButton defaultTab = { SETTINGS_TABS.CALENDAR } />
251
                     <SettingsButton defaultTab = { SETTINGS_TABS.CALENDAR } />
237
                 </div>
252
                 </div>
238
-                <Tabs tabs = { tabs } />
253
+                <Tabs
254
+                    onSelect = { this._onTabSelected }
255
+                    selected = { this.state.selectedTab }
256
+                    tabs = { tabs } />
239
             </div>);
257
             </div>);
240
     }
258
     }
241
 
259
 

Loading…
Cancel
Save