@atlaskit/link-datasource 0.33.11 → 0.33.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 0.33.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0aadfa0dc26`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0aadfa0dc26) - Fix double loading inside table view
8
+
3
9
  ## 0.33.11
4
10
 
5
11
  ### Patch Changes
@@ -36,9 +36,16 @@ var DatasourceTableView = function DatasourceTableView(_ref) {
36
36
  totalCount = _useDatasourceTableSt.totalCount,
37
37
  loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails;
38
38
 
39
- // Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
39
+ /* Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
40
+ But we don't want to call it on initial load. This screws up useDatasourceTableState's internal
41
+ mechanism of initial loading. Use of ref here makes it basically work as a `componentDidUpdate` but not `componentDidMount`
42
+ */
43
+ var isInitialRender = (0, _react.useRef)(true);
40
44
  (0, _react.useEffect)(function () {
41
- reset();
45
+ if (!isInitialRender.current) {
46
+ reset();
47
+ }
48
+ isInitialRender.current = false;
42
49
  }, [reset, parameters]);
43
50
  (0, _react.useEffect)(function () {
44
51
  if (onVisibleColumnKeysChange && (visibleColumnKeys || []).length === 0 && defaultVisibleColumnKeys.length > 0) {
@@ -344,7 +344,7 @@ var analyticsContextAttributes = {
344
344
  };
345
345
  var analyticsContextData = {
346
346
  packageName: "@atlaskit/link-datasource",
347
- packageVersion: "0.33.11",
347
+ packageVersion: "0.33.12",
348
348
  source: 'datasourceConfigModal'
349
349
  };
350
350
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.11",
3
+ "version": "0.33.12",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { useCallback, useEffect } from 'react';
2
+ import { useCallback, useEffect, useRef } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import { useDatasourceTableState } from '../../hooks/useDatasourceTableState';
5
5
  import { AccessRequired } from '../common/error-state/access-required';
@@ -30,9 +30,16 @@ export const DatasourceTableView = ({
30
30
  fieldKeys: visibleColumnKeys
31
31
  });
32
32
 
33
- // Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
33
+ /* Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
34
+ But we don't want to call it on initial load. This screws up useDatasourceTableState's internal
35
+ mechanism of initial loading. Use of ref here makes it basically work as a `componentDidUpdate` but not `componentDidMount`
36
+ */
37
+ const isInitialRender = useRef(true);
34
38
  useEffect(() => {
35
- reset();
39
+ if (!isInitialRender.current) {
40
+ reset();
41
+ }
42
+ isInitialRender.current = false;
36
43
  }, [reset, parameters]);
37
44
  useEffect(() => {
38
45
  if (onVisibleColumnKeysChange && (visibleColumnKeys || []).length === 0 && defaultVisibleColumnKeys.length > 0) {
@@ -290,7 +290,7 @@ const analyticsContextAttributes = {
290
290
  };
291
291
  const analyticsContextData = {
292
292
  packageName: "@atlaskit/link-datasource",
293
- packageVersion: "0.33.11",
293
+ packageVersion: "0.33.12",
294
294
  source: 'datasourceConfigModal'
295
295
  };
296
296
  const contextData = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.11",
3
+ "version": "0.33.12",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { useCallback, useEffect } from 'react';
2
+ import { useCallback, useEffect, useRef } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import { useDatasourceTableState } from '../../hooks/useDatasourceTableState';
5
5
  import { AccessRequired } from '../common/error-state/access-required';
@@ -28,9 +28,16 @@ export var DatasourceTableView = function DatasourceTableView(_ref) {
28
28
  totalCount = _useDatasourceTableSt.totalCount,
29
29
  loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails;
30
30
 
31
- // Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
31
+ /* Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
32
+ But we don't want to call it on initial load. This screws up useDatasourceTableState's internal
33
+ mechanism of initial loading. Use of ref here makes it basically work as a `componentDidUpdate` but not `componentDidMount`
34
+ */
35
+ var isInitialRender = useRef(true);
32
36
  useEffect(function () {
33
- reset();
37
+ if (!isInitialRender.current) {
38
+ reset();
39
+ }
40
+ isInitialRender.current = false;
34
41
  }, [reset, parameters]);
35
42
  useEffect(function () {
36
43
  if (onVisibleColumnKeysChange && (visibleColumnKeys || []).length === 0 && defaultVisibleColumnKeys.length > 0) {
@@ -334,7 +334,7 @@ var analyticsContextAttributes = {
334
334
  };
335
335
  var analyticsContextData = {
336
336
  packageName: "@atlaskit/link-datasource",
337
- packageVersion: "0.33.11",
337
+ packageVersion: "0.33.12",
338
338
  source: 'datasourceConfigModal'
339
339
  };
340
340
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.11",
3
+ "version": "0.33.12",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.11",
3
+ "version": "0.33.12",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"