Skip to content

Commit

Permalink
automatic chores: linting [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-automatic-chores committed May 30, 2024
1 parent 612b9aa commit 22b7ec6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
EditFilled,
EditRegular,
FormNewFilled,
FormNewRegular, bundleIcon
FormNewRegular,
bundleIcon
} from '@fluentui/react-icons'

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ export function useExcelExport(context: IPortfolioAggregationContext) {
return
}

const items =
!_.isEmpty(context.state.selectedItems)
? context.state.selectedItems
: context.state.items.filter((item) => {
const items = !_.isEmpty(context.state.selectedItems)
? context.state.selectedItems
: context.state.items.filter((item) => {
if (Object.keys(context.state.activeFilters).length === 0) {
return true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
AppsListRegular,
TextBulletListLtrRegular} from '@fluentui/react-icons'
import { AppsListRegular, TextBulletListLtrRegular } from '@fluentui/react-icons'
import * as strings from 'PortfolioWebPartsStrings'
import { ListMenuItem, ListMenuItemDivider } from 'pp365-shared-library'
import { useMemo } from 'react'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class CopyListData extends BaseTask {
.split('|')
.map((str) => new TaskAttachment(str))
.filter((attachment) => !stringIsNullOrEmpty(attachment.url))
} catch (error) { }
} catch (error) {}
}
if (!stringIsNullOrEmpty(item.GtPlannerPreviewType)) {
let m: RegExpExecArray
Expand Down Expand Up @@ -287,8 +287,9 @@ export class CopyListData extends BaseTask {
): Promise<void> {
try {
await folders.sort().reduce((chain: Promise<any>, folder, index: number) => {
const folderServerRelUrl = `${config.destListProps.RootFolder.ServerRelativeUrl
}/${folder.replace(config.sourceListProps.RootFolder.ServerRelativeUrl, '')}`
const folderServerRelUrl = `${
config.destListProps.RootFolder.ServerRelativeUrl
}/${folder.replace(config.sourceListProps.RootFolder.ServerRelativeUrl, '')}`
this.onProgress(
progressText,
format(strings.ProcessFolderText, index + 1, folders.length),
Expand Down Expand Up @@ -340,8 +341,9 @@ export class CopyListData extends BaseTask {
const filesCopied = []
for (let i = 0; i < filesWithContents.length; i++) {
const file = filesWithContents[i]
const destFolderUrl = `${config.destListProps.RootFolder.ServerRelativeUrl
}${file.FileDirRef.replace(config.sourceListProps.RootFolder.ServerRelativeUrl, '')}`
const destFolderUrl = `${
config.destListProps.RootFolder.ServerRelativeUrl
}${file.FileDirRef.replace(config.sourceListProps.RootFolder.ServerRelativeUrl, '')}`
try {
this.logInformation(`Copying file ${file.LinkFilename}`)
this.onProgress(
Expand All @@ -355,7 +357,7 @@ export class CopyListData extends BaseTask {
.files.addUsingPath(filename, file.Blob, { Overwrite: true })
filesCopied.push(fileAddResult)
this.logInformation(`Successfully copied file ${file.LinkFilename}`)
} catch (err) { }
} catch (err) {}
}
return filesCopied
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ class ExcelExportService {
* @param fileNamePart Optional file name part to add after the name and before the date
* @param sheetNamePrefix Optional prefix for the sheet name
*/
public export(items: Record<string, any>[], columns: IColumn[], fileNamePart?: string, sheetNamePrefix: string = 'Sheet') {
public export(
items: Record<string, any>[],
columns: IColumn[],
fileNamePart?: string,
sheetNamePrefix: string = 'Sheet'
) {
const fileNameFormat = fileNamePart ? '{0}-{1}-{2}.xlsx' : '{0}-{1}.xlsx'
try {
const sheets = []
Expand All @@ -43,16 +48,18 @@ class ExcelExportService {
name: this.configuration.sheetName,
data: [
_columns.map((column) => column.name),
...items.map((item) => _columns.map((column) => {
switch ((column as any).dataType) {
case 'date': {
return getDateValue(item, column.fieldName)
...items.map((item) =>
_columns.map((column) => {
switch ((column as any).dataType) {
case 'date': {
return getDateValue(item, column.fieldName)
}
default: {
return get(item, column.fieldName, null)
}
}
default: {
return get(item, column.fieldName, null)
}
}
}))
})
)
]
})
const workBook = XLSX.utils.book_new()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Get date value from item.
*
*
* @param item Item/record to get date value from.
* @param fieldName The field name of the date value.
*/
Expand Down

0 comments on commit 22b7ec6

Please sign in to comment.