From 7744d310a00087e510d2c44f164b288517a3b507 Mon Sep 17 00:00:00 2001 From: Romaric Mourgues Date: Wed, 19 Apr 2023 15:46:28 +0200 Subject: [PATCH] Removed temp fix --- .../web/controllers/company-applications.ts | 2 +- .../features/applications/hooks/temp-fix.ts | 57 ------------------- .../applications/hooks/use-applications.ts | 3 +- .../hooks/use-company-applications.ts | 3 +- 4 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 tdrive/frontend/src/app/features/applications/hooks/temp-fix.ts diff --git a/tdrive/backend/node/src/services/applications/web/controllers/company-applications.ts b/tdrive/backend/node/src/services/applications/web/controllers/company-applications.ts index 8885eb78..495fcb41 100644 --- a/tdrive/backend/node/src/services/applications/web/controllers/company-applications.ts +++ b/tdrive/backend/node/src/services/applications/web/controllers/company-applications.ts @@ -54,7 +54,7 @@ export class CompanyApplicationController return { resources: resources.getEntities().map(ca => ca.application), - next_page_token: resources.nextPage.page_token, + next_page_token: resources.nextPage?.page_token, websockets: gr.platformServices.realtime.sign( getCompanyApplicationRooms(request.params.company_id), diff --git a/tdrive/frontend/src/app/features/applications/hooks/temp-fix.ts b/tdrive/frontend/src/app/features/applications/hooks/temp-fix.ts deleted file mode 100644 index 8b597266..00000000 --- a/tdrive/frontend/src/app/features/applications/hooks/temp-fix.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Application } from '../types/application'; - -export const replaceOnlyOfficeForCanary = (applications: Application[]) => { - return applications.map(application => { - if ( - application?.identity?.code === 'only_office' && - !application.display?.tdrive?.files?.editor?.preview_url?.includes('plugins.tdrive.app') - ) { - return { - ...application, - display: { - tdrive: { - version: 1, - files: { - editor: { - preview_url: 'https://plugins.tdrive.app/plugins/onlyoffice/?preview=1', - edition_url: 'https://plugins.tdrive.app/plugins/onlyoffice/', - empty_files: [ - { - url: 'https://plugins.tdrive.app/plugins/onlyoffice/assets/empty.docx', - filename: 'Untitled.docx', - name: 'ONLYOFFICE Word Document', - }, - { - url: 'https://plugins.tdrive.app/plugins/onlyoffice/assets/empty.xlsx', - filename: 'Untitled.xlsx', - name: 'ONLYOFFICE Excel Document', - }, - { - url: 'https://plugins.tdrive.app/plugins/onlyoffice/assets/empty.pptx', - filename: 'Untitled.pptx', - name: 'ONLYOFFICE PowerPoint Document', - }, - ], - extensions: [ - 'xlsx', - 'pptx', - 'docx', - 'xls', - 'ppt', - 'doc', - 'odt', - 'ods', - 'odp', - 'txt', - 'html', - 'csv', - ], - }, - }, - }, - }, - }; - } - return application; - }); -}; diff --git a/tdrive/frontend/src/app/features/applications/hooks/use-applications.ts b/tdrive/frontend/src/app/features/applications/hooks/use-applications.ts index 27b79890..bdebed00 100644 --- a/tdrive/frontend/src/app/features/applications/hooks/use-applications.ts +++ b/tdrive/frontend/src/app/features/applications/hooks/use-applications.ts @@ -1,7 +1,6 @@ import { useEffect, useRef, useState } from 'react'; import { Application } from 'app/features/applications/types/application'; import ApplicationsAPIClient from '../api/applications-api-client'; -import { replaceOnlyOfficeForCanary } from './temp-fix'; export function useApplications() { const [loading, setLoading] = useState(true); @@ -21,7 +20,7 @@ export function useApplications() { }, []); return { - applications: applications && replaceOnlyOfficeForCanary(applications), + applications: applications, loading, search, }; diff --git a/tdrive/frontend/src/app/features/applications/hooks/use-company-applications.ts b/tdrive/frontend/src/app/features/applications/hooks/use-company-applications.ts index 1696a251..35fc810a 100644 --- a/tdrive/frontend/src/app/features/applications/hooks/use-company-applications.ts +++ b/tdrive/frontend/src/app/features/applications/hooks/use-company-applications.ts @@ -15,7 +15,6 @@ import { LoadingState } from 'app/features/global/state/atoms/Loading'; import useRouterWorkspace from 'app/features/router/hooks/use-router-workspace'; import { useGlobalEffect } from 'app/features/global/hooks/use-global-effect'; import useRouterCompany from 'app/features/router/hooks/use-router-company'; -import { replaceOnlyOfficeForCanary } from './temp-fix'; const logger = Logger.getLogger('useApplications'); /** @@ -93,7 +92,7 @@ export function useCompanyApplications(companyId = '') { const isInstalled = (applicationId: string) => (get(applicationId) ? true : false); return { - applications: replaceOnlyOfficeForCanary(applications), + applications: applications, get, loading, add,