sea-chart 0.0.96 → 0.0.97

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.
@@ -1,7 +1,7 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import shallowEqual from 'shallowequal';
3
3
  import dayjs from 'dayjs';
4
- import { CellType, COLLABORATOR_COLUMN_TYPES, FORMULA_RESULT_TYPE, getOption, getCollaborator, getNumberDisplayString, isNumber } from 'dtable-utils';
4
+ import { CellType, COLLABORATOR_COLUMN_TYPES, FORMULA_RESULT_TYPE, getOption, getCollaborator, getNumberDisplayString, isNumber, isValidEmail } from 'dtable-utils';
5
5
  import { getClientFormulaDisplayString, getKnownCollaboratorByEmail, getColumnOptions, getDateColumnFormat, generateDefaultUser } from '../../../utils';
6
6
  import { Collaborator } from '../../../components';
7
7
  import intl from '../../../intl';
@@ -18,7 +18,13 @@ class PivotTableDisplayName extends React.Component {
18
18
  }
19
19
  return type;
20
20
  };
21
- this.updateCreator = email => {
21
+ this.updateCreator = (email, rowData) => {
22
+ if (!isValidEmail(email)) {
23
+ const {
24
+ original_name
25
+ } = rowData;
26
+ email = original_name;
27
+ }
22
28
  let creator = getKnownCollaboratorByEmail(email);
23
29
  if (creator) {
24
30
  this.setState({
@@ -299,21 +305,23 @@ class PivotTableDisplayName extends React.Component {
299
305
  componentDidMount() {
300
306
  let {
301
307
  column,
302
- value
308
+ value,
309
+ rowData
303
310
  } = this.props;
304
311
  const type = this.getType(column);
305
312
  if (type !== CellType.CREATOR && type !== CellType.LAST_MODIFIER) return;
306
- this.updateCreator(value);
313
+ this.updateCreator(value, rowData);
307
314
  }
308
315
  UNSAFE_componentWillReceiveProps(nextProps) {
309
316
  let {
310
317
  column,
311
- value
318
+ value,
319
+ rowData
312
320
  } = nextProps;
313
321
  const type = this.getType(column);
314
322
  if (type !== CellType.CREATOR && type !== CellType.LAST_MODIFIER) return;
315
323
  if (value !== this.props.value || shallowEqual(nextProps.column, this.props.column)) {
316
- this.updateCreator(value);
324
+ this.updateCreator(value, rowData);
317
325
  }
318
326
  }
319
327
  render() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "0.0.96",
3
+ "version": "0.0.97",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",