Skip to content

Commit

Permalink
Add UNSAFE to tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kzadurska committed Mar 9, 2022
1 parent 11c2337 commit 8bf9ca9
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class TurniloApplication extends React.Component<TurniloApplicationProps,
});
}

componentWillMount() {
UNSAFE_componentWillMount() {
const { initTimekeeper, appSettings: { oauth } } = this.props;

if (!!oauth && hasCode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class DateRangeInput extends React.Component<DateRangeInputProps, DateRan
this.updateStateFromTime(time, timezone);
}

componentWillReceiveProps(nextProps: DateRangeInputProps) {
UNSAFE_componentWillReceiveProps(nextProps: DateRangeInputProps) {
const { time, timezone } = nextProps;
this.updateStateFromTime(time, timezone);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class NumberFilterMenu extends React.Component<NumberFilterMenuProps, Num
end: ANY_VALUE
};

componentWillMount() {
UNSAFE_componentWillMount() {
const { essence, dimension } = this.props;
const clause = essence.filter.getClauseForDimension(dimension);
if (!clause) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class GlobalEventListener extends React.Component<GlobalEventListenerProp
left: "keydown"
};

componentWillReceiveProps(nextProps: GlobalEventListenerProps) {
UNSAFE_componentWillReceiveProps(nextProps: GlobalEventListenerProps) {
this.refreshListeners(nextProps, this.props);
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Modal extends React.Component<ModalProps, ModalState> {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
var { id } = this.props;

this.setState({
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/notifications/notification-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class NotificationCard extends React.Component<NotificationCardProps, Not
});
}

componentWillReceiveProps(nextProps: NotificationCardProps) {
UNSAFE_componentWillReceiveProps(nextProps: NotificationCardProps) {
if (nextProps.model && nextProps.model.discarded) {
this.disappear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class PreviewStringFilterMenu extends React.Component<PreviewStringFilter

private debouncedQueryFilter = debounceWithPromise(this.queryFilter, SEARCH_WAIT);

componentWillMount() {
UNSAFE_componentWillMount() {
this.loadRows();
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class Router extends React.Component<RouterProps, RouterState> {
return hash.replace(new RegExp("^#" + rootFragment, "gi"), "");
}

componentWillReceiveProps(nextProps: RouterProps) {
UNSAFE_componentWillReceiveProps(nextProps: RouterProps) {
this.globalHashChangeListener();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class SearchableFolder extends PureComponent<SearchableFolderProps, Searc
this.state = { opened: inSearchMode && hasItemsWithSearchText || shouldBeOpened };
}

componentWillReceiveProps(nextProps: Readonly<SearchableFolderProps>) {
UNSAFE_componentWillReceiveProps(nextProps: Readonly<SearchableFolderProps>) {
const { opened } = this.state;
const { shouldBeOpened } = this.props;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class SelectableStringFilterMenu extends React.Component<SelectableString

private debouncedQueryFilter = debounceWithPromise(this.queryFilter, SEARCH_WAIT);

componentWillMount() {
UNSAFE_componentWillMount() {
this.loadRows();
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/split-menu/split-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SplitMenu extends React.Component<SplitMenuProps, SplitMenuState> {

state: SplitMenuState = {};

componentWillMount() {
UNSAFE_componentWillMount() {
const { split } = this.props;
const { bucket, sort, limit } = split;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class CubeHeaderBar extends React.Component<CubeHeaderBarProps, CubeHeade
this.mounted = true;
}

componentWillReceiveProps(nextProps: CubeHeaderBarProps) {
UNSAFE_componentWillReceiveProps(nextProps: CubeHeaderBarProps) {
if (!this.props.updatingMaxTime && nextProps.updatingMaxTime) {
this.setState({ animating: true });
setTimeout(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/client/views/cube-view/cube-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class CubeView extends React.Component<CubeViewProps, CubeViewState> {
});
};

componentWillMount() {
UNSAFE_componentWillMount() {
const { hash, dataCube, initTimekeeper } = this.props;
if (!dataCube) {
throw new Error("Data cube is required.");
Expand All @@ -240,7 +240,7 @@ export class CubeView extends React.Component<CubeViewProps, CubeViewState> {
this.globalResizeListener();
}

componentWillReceiveProps(nextProps: CubeViewProps) {
UNSAFE_componentWillReceiveProps(nextProps: CubeViewProps) {
const { hash, dataCube } = this.props;
if (!nextProps.dataCube) {
throw new Error("Data cube is required.");
Expand All @@ -251,7 +251,7 @@ export class CubeView extends React.Component<CubeViewProps, CubeViewState> {
}
}

componentWillUpdate(nextProps: CubeViewProps, nextState: CubeViewState): void {
UNSAFE_componentWillUpdate(nextProps: CubeViewProps, nextState: CubeViewState): void {
const { changeCubeAndEssence, dataCube } = this.props;
const { essence } = this.state;
if (!nextState.essence.equals(essence)) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/visualizations/data-provider/data-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class DataProvider extends React.Component<DataProviderProps, DataProvide
this.debouncedCallExecutor.cancel();
}

componentWillReceiveProps(nextProps: DataProviderProps) {
UNSAFE_componentWillReceiveProps(nextProps: DataProviderProps) {
if (this.shouldFetchData(nextProps) && this.visualisationNotResized(nextProps)) {
const { essence, timekeeper, queryFactory } = nextProps;
const hadDataLoaded = isLoaded(this.state.dataset);
Expand Down

0 comments on commit 8bf9ca9

Please sign in to comment.