Resolve build errors

This commit is contained in:
Joel Rodrigues 2020-10-20 16:21:15 +01:00
parent 0704714912
commit c426f53f13
3 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,6 @@
import {IListViewItems } from "./IListViewItems"; import {IListViewItems } from "./IListViewItems";
import { WebPartContext } from '@microsoft/sp-webpart-base'; import { WebPartContext } from '@microsoft/sp-webpart-base';
import { SyntheticEvent } from "react";
export enum panelMode { export enum panelMode {
"New", "New",
"edit", "edit",
@ -10,6 +11,6 @@ export interface ITenantPropertyPanelProps {
mode:panelMode; mode:panelMode;
showPanel: boolean; showPanel: boolean;
TenantProperty: IListViewItems ; TenantProperty: IListViewItems ;
onDismiss(refresh?:boolean) : void; onDismiss(ev?: SyntheticEvent<HTMLElement, Event>, refresh?: boolean) : void;
context: WebPartContext; context: WebPartContext;
} }

View File

@ -19,6 +19,7 @@ import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBa
import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner'; import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner';
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle"; import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
import * as strings from 'TenantPropertiesWebPartStrings'; import * as strings from 'TenantPropertiesWebPartStrings';
import { SyntheticEvent } from 'react';
// ListView Columns // ListView Columns
const viewFields: IViewField[] = [ const viewFields: IViewField[] = [
@ -97,7 +98,7 @@ export default class TenantProperties extends React.Component<ITenantPropertiesP
} }
// Panel Dismiss CallBack // Panel Dismiss CallBack
// @param refresh refresh list? // @param refresh refresh list?
public async onDismissPanel(refresh?: boolean) { public async onDismissPanel(ev?: SyntheticEvent<HTMLElement, Event>, refresh?: boolean) {
this.setState({ this.setState({
showPanel: false showPanel: false
}); });

View File

@ -58,7 +58,9 @@ export default class TenantPropertyPanel extends React.Component<ITenantProperty
Description: this.state.tenantProperty.tenantPropertyDescription, Description: this.state.tenantProperty.tenantPropertyDescription,
Comment: this.state.tenantProperty.tenantPropertyComment Comment: this.state.tenantProperty.tenantPropertyComment
}); });
result ? this.props.onDismiss(true) : null; if (result) {
this.props.onDismiss(null, true);
}
}catch(error){ }catch(error){
this.setState({errorMessage:error}); this.setState({errorMessage:error});
} }
@ -72,7 +74,9 @@ export default class TenantPropertyPanel extends React.Component<ITenantProperty
Description: this.state.tenantProperty.tenantPropertyDescription, Description: this.state.tenantProperty.tenantPropertyDescription,
Comment: this.state.tenantProperty.tenantPropertyComment Comment: this.state.tenantProperty.tenantPropertyComment
}); });
result ? this.props.onDismiss(true) : null; if (result) {
this.props.onDismiss(null, true);
}
}catch(error){ }catch(error){
this.setState({errorMessage:error}); this.setState({errorMessage:error});
} }
@ -86,7 +90,9 @@ export default class TenantPropertyPanel extends React.Component<ITenantProperty
Description: this.state.tenantProperty.tenantPropertyDescription, Description: this.state.tenantProperty.tenantPropertyDescription,
Comment: this.state.tenantProperty.tenantPropertyComment Comment: this.state.tenantProperty.tenantPropertyComment
}); });
result ? this.props.onDismiss(true) : null; if (result) {
this.props.onDismiss(null, true);
}
}catch(error){ }catch(error){
this.setState({errorMessage:error}); this.setState({errorMessage:error});
} }