[APPS-2157][APPS-2158][APPS-2161][APPS-2162][APPS-2165] Migration from moment to date-fns (#8965)

* [APPS-2157][APPS-2158][APPS-2161][APPS-2162][2165] Migration from  moment to date-fns

* Modified endDate to CompletedDate

* Addressed review comments

* Revert import for dataFnsUtil

* Replace fit to it

* fix types and avoid double date conversion

* fix lint issue

* support iso strings for date formatting

---------

Co-authored-by: Denys Vuika <denys.vuika@gmail.com>
This commit is contained in:
Kritagya Jaiswal
2023-10-06 01:30:46 +05:30
committed by GitHub
parent ecbee581a7
commit ea65756660
7 changed files with 64 additions and 39 deletions

View File

@@ -34,7 +34,7 @@ export class UploadActions {
this.nodesApi = new NodesApi(apiService.getInstance());
}
async uploadFile(fileLocation, fileName, parentFolderId): Promise<any> {
async uploadFile(fileLocation: fs.PathLike, fileName: string, parentFolderId: string): Promise<NodeEntry> {
const file = fs.createReadStream(fileLocation);
return this.uploadApi.uploadFile(
@@ -50,7 +50,7 @@ export class UploadActions {
);
}
async createEmptyFiles(emptyFileNames: string[], parentFolderId): Promise<NodeEntry> {
async createEmptyFiles(emptyFileNames: string[], parentFolderId: string): Promise<NodeEntry> {
const filesRequest = [];
// eslint-disable-next-line @typescript-eslint/prefer-for-of
@@ -64,7 +64,7 @@ export class UploadActions {
return this.nodesApi.createNode(parentFolderId, filesRequest as any, {});
}
async createFolder(folderName, parentFolderId): Promise<NodeEntry> {
async createFolder(folderName: string, parentFolderId: string): Promise<NodeEntry> {
return this.nodesApi.createNode(parentFolderId, {
name: folderName,
nodeType: 'cm:folder'