Removed temp fix
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ export class CompanyApplicationController
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
resources: resources.getEntities().map(ca => ca.application),
|
resources: resources.getEntities().map(ca => ca.application),
|
||||||
next_page_token: resources.nextPage.page_token,
|
next_page_token: resources.nextPage?.page_token,
|
||||||
websockets:
|
websockets:
|
||||||
gr.platformServices.realtime.sign(
|
gr.platformServices.realtime.sign(
|
||||||
getCompanyApplicationRooms(request.params.company_id),
|
getCompanyApplicationRooms(request.params.company_id),
|
||||||
|
|||||||
@@ -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;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { Application } from 'app/features/applications/types/application';
|
import { Application } from 'app/features/applications/types/application';
|
||||||
import ApplicationsAPIClient from '../api/applications-api-client';
|
import ApplicationsAPIClient from '../api/applications-api-client';
|
||||||
import { replaceOnlyOfficeForCanary } from './temp-fix';
|
|
||||||
|
|
||||||
export function useApplications() {
|
export function useApplications() {
|
||||||
const [loading, setLoading] = useState<boolean>(true);
|
const [loading, setLoading] = useState<boolean>(true);
|
||||||
@@ -21,7 +20,7 @@ export function useApplications() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
applications: applications && replaceOnlyOfficeForCanary(applications),
|
applications: applications,
|
||||||
loading,
|
loading,
|
||||||
search,
|
search,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import { LoadingState } from 'app/features/global/state/atoms/Loading';
|
|||||||
import useRouterWorkspace from 'app/features/router/hooks/use-router-workspace';
|
import useRouterWorkspace from 'app/features/router/hooks/use-router-workspace';
|
||||||
import { useGlobalEffect } from 'app/features/global/hooks/use-global-effect';
|
import { useGlobalEffect } from 'app/features/global/hooks/use-global-effect';
|
||||||
import useRouterCompany from 'app/features/router/hooks/use-router-company';
|
import useRouterCompany from 'app/features/router/hooks/use-router-company';
|
||||||
import { replaceOnlyOfficeForCanary } from './temp-fix';
|
|
||||||
|
|
||||||
const logger = Logger.getLogger('useApplications');
|
const logger = Logger.getLogger('useApplications');
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +92,7 @@ export function useCompanyApplications(companyId = '') {
|
|||||||
const isInstalled = (applicationId: string) => (get(applicationId) ? true : false);
|
const isInstalled = (applicationId: string) => (get(applicationId) ? true : false);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
applications: replaceOnlyOfficeForCanary(applications),
|
applications: applications,
|
||||||
get,
|
get,
|
||||||
loading,
|
loading,
|
||||||
add,
|
add,
|
||||||
|
|||||||
Reference in New Issue
Block a user