Update KanbanBoard.tsx

Fixed linting issues
This commit is contained in:
Hugo Bernier 2020-04-21 19:45:41 -04:00 committed by GitHub
parent 91318c4e09
commit 426b91707d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 17 deletions

View File

@ -16,12 +16,12 @@ import JqxKanban, { IKanbanProps, jqx, IKanbanSource } from 'jqwidgets-scripts/j
const rowStyle1: IStackStyles = { const rowStyle1: IStackStyles = {
root:{ root:{
flexBasis:"30%" flexBasis:"30%"
} }
}; };
const rowStyle2: IStackStyles = { const rowStyle2: IStackStyles = {
root:{ root:{
flexBasis:"70%" flexBasis:"70%"
} }
}; };
export interface ICustomKanbanProps extends IKanbanProps{ export interface ICustomKanbanProps extends IKanbanProps{
@ -95,11 +95,11 @@ export default class KanbanBoard extends React.Component<IKanbanBoardProps, ICus
public render(): React.ReactElement<IKanbanBoardProps> { public render(): React.ReactElement<IKanbanBoardProps> {
const el = this.state.showBoard ? const el = this.state.showBoard ?
!this.state.noItems ? <JqxKanban !this.state.noItems ? <JqxKanban
width={this.state.width} width={this.state.width}
height={"100%"} height={"100%"}
source={this.state.source} source={this.state.source}
columns={this.state.columns} columns={this.state.columns}
resources={this.state.resources} resources={this.state.resources}
onItemMoved={this._updateTask} onItemMoved={this._updateTask}
itemRenderer={this.state.itemRenderer} itemRenderer={this.state.itemRenderer}
@ -187,24 +187,24 @@ export default class KanbanBoard extends React.Component<IKanbanBoardProps, ICus
this._getData(this.props.listTitle); this._getData(this.props.listTitle);
} }
_getData = (listTitle) => { private _getData = (listTitle) => {
if(listTitle && listTitle.length > 0) if(listTitle && listTitle.length > 0)
{ {
sp.web.lists.getByTitle(listTitle).fields.getByInternalNameOrTitle("Status").get() sp.web.lists.getByTitle(listTitle).fields.getByInternalNameOrTitle("Status").get()
.then(status => { .then(status => {
const cols = status.Choices.map((val,index) => { const cols = status.Choices.map((val,index) => {
return { text: val, dataField: val }; return { text: val, dataField: val };
}); });
sp.web.lists.getByTitle(listTitle).items.getAll().then(res => { sp.web.lists.getByTitle(listTitle).items.getAll().then(res => {
const source = { const source = {
dataFields: this.sourceFields, dataFields: this.sourceFields,
dataType: 'array', dataType: 'array',
localData: [ ...res ] localData: [ ...res ]
}; };
sp.web.siteUsers.get().then(users => { sp.web.siteUsers.get().then(users => {
const resourcesAdapterFunc = (): any => { const resourcesAdapterFunc = (): any => {
const resourcesSource = { const resourcesSource = {
@ -215,7 +215,7 @@ export default class KanbanBoard extends React.Component<IKanbanBoardProps, ICus
const resourcesDataAdapter = new jqx.dataAdapter(resourcesSource); const resourcesDataAdapter = new jqx.dataAdapter(resourcesSource);
return resourcesDataAdapter; return resourcesDataAdapter;
}; };
this.setState({ this.setState({
width: "100%", width: "100%",
columns: cols, columns: cols,
@ -234,7 +234,7 @@ export default class KanbanBoard extends React.Component<IKanbanBoardProps, ICus
} }
} }
_updateTask = (event: any): void => { private _updateTask = (event: any): void => {
let args = event.args; let args = event.args;
// let itemId = args.itemId; // let itemId = args.itemId;
// let oldParentId = args.oldParentId; // let oldParentId = args.oldParentId;
@ -249,7 +249,7 @@ export default class KanbanBoard extends React.Component<IKanbanBoardProps, ICus
}); });
} }
_showTask = (event:any): void => { private _showTask = (event:any): void => {
if(event.args.attribute === "template") if(event.args.attribute === "template")
{ {
this.setState({ this.setState({
@ -257,11 +257,11 @@ export default class KanbanBoard extends React.Component<IKanbanBoardProps, ICus
...event.args.item ...event.args.item
}, },
hideDialog: false hideDialog: false
}); });
} }
} }
_closeDialog = (): void => { private _closeDialog = (): void => {
this.setState({ hideDialog: true }); this.setState({ hideDialog: true });
} }
} }