Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/dashboard",
"comment": "Using _async fabric utility functions to prevent timeout leaks",
"type": "patch"
}
],
"packageName": "@uifabric/dashboard",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react';

import { Panel, PanelType } from 'office-ui-fabric-react/lib/Panel';
import { classNamesFunction } from 'office-ui-fabric-react/lib/Utilities';
import { classNamesFunction, BaseComponent } from 'office-ui-fabric-react/lib/Utilities';

import { AddCard } from './AddCard/AddCard';
import { getStyles } from './AddCardPanel.styles';
import { IAddCardPanelProps, IAddCardPanelState, IAddCardPanelStyles } from './AddCardPanel.types';
import { IDGLCard } from '../../../index';

export class AddCardPanel extends React.Component<IAddCardPanelProps, IAddCardPanelState> {
export class AddCardPanel extends BaseComponent<IAddCardPanelProps, IAddCardPanelState> {
constructor(props: IAddCardPanelProps) {
super(props);
this.state = {
Expand Down Expand Up @@ -87,7 +87,7 @@ export class AddCardPanel extends React.Component<IAddCardPanelProps, IAddCardPa
}
});
// the time for which the add card panel stays half hidden after successfully adding a card
setTimeout(() => {
this._async.setTimeout(() => {
this.setState({ flyoutStyle: {} });
}, 1000);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { IStyle } from 'office-ui-fabric-react/lib/Styling';
import { IBaseProps } from 'office-ui-fabric-react/lib/Utilities';
import { IDGLCard } from '../../../index';

export interface IAddCardPanelProps {
export interface IAddCardPanelProps extends IBaseProps {
/**
* The title for the add card panel
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Layout } from 'react-grid-layout';
import { BaseComponent } from 'office-ui-fabric-react/lib/Utilities';
import {
IDashboardGridLayoutWithAddCardPanelProps,
IDashboardGridLayoutWithAddCardPanelState
Expand All @@ -15,7 +16,7 @@ import {
} from '../../../index';
import { getCardStyles, getClassNames } from './DashboardGridLayoutWithAddCardPanel.styles';

export class DashboardGridLayoutWithAddCardPanel extends React.Component<
export class DashboardGridLayoutWithAddCardPanel extends BaseComponent<
IDashboardGridLayoutWithAddCardPanelProps,
IDashboardGridLayoutWithAddCardPanelState
> {
Expand Down Expand Up @@ -144,7 +145,7 @@ export class DashboardGridLayoutWithAddCardPanel extends React.Component<
layout: layout
});
// scroll to the card that was added to the layout
setTimeout(() => {
this._async.setTimeout(() => {
if (document.getElementById(cardId + 'dglCard')) {
document.getElementById(cardId + 'dglCard')!.scrollIntoView({ behavior: 'smooth' });
const css = getClassNames(getCardStyles!);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { IBaseProps } from 'office-ui-fabric-react/lib/Utilities';
import { DashboardGridBreakpointLayouts } from '../DashboardGridLayout.types';
import { IDGLCard, ISection } from '../../../index';

export interface IDashboardGridLayoutWithAddCardPanelProps {
export interface IDashboardGridLayoutWithAddCardPanelProps extends IBaseProps {
/**
* prop to open the add card panel
*/
Expand Down