🔄 Rename all "twake" instances to "tdrive"

🔄 Rename all "twake" instances to "tdrive"
This commit is contained in:
Montassar Ghanmy
2023-04-10 14:12:00 +01:00
committed by GitHub
parent 88cba77421
commit d91a13e2cc
323 changed files with 1021 additions and 1023 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ export const Logo = (props: PropsType): React.ReactElement => {
<img
className="mx-auto w-auto"
src={`/public/img/logo/${size}x${size}.png`}
alt="Twake logo"
alt="Tdrive logo"
/>
</div>
);
@@ -127,9 +127,9 @@ export default class AttachmentPicker extends Component {
type: 'menu',
icon: 'folder',
text: Languages.t(
'components.attachmentpicker.from_twake',
'components.attachmentpicker.from_tdrive',
[],
'From Twake Documents',
'From Tdrive Documents',
),
submenu: [
{
@@ -4,7 +4,7 @@ import Tooltip from 'components/tooltip/tooltip.jsx';
import moment from 'moment';
import DateTimeUtils from 'app/features/global/utils/datetime.js';
import UserService from 'app/features/users/services/current-user-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import DayPicker from './day-picker/day-picker.jsx';
import MenusManager from 'app/components/menus/menus-manager.jsx';
import Input from 'components/inputs/input.jsx';
@@ -39,7 +39,7 @@ export default class ComponentsTester extends React.Component {
<div className="componentTester">
<div className="section">
<div className="title">Test des composants</div>
<div className="subtitle">ctrl+alt+e pour revenir à Twake</div>
<div className="subtitle">ctrl+alt+e pour revenir à Tdrive</div>
</div>
<GroupInputs />
@@ -2,13 +2,13 @@
import React from 'react';
import { useRecoilCallback } from 'recoil';
interface TwakeDebugState {
interface TdriveDebugState {
dumpStateSnapshot?(): void;
get?(key: string): void;
getAllAtoms?(): void;
}
const twakeDebugState: TwakeDebugState = {};
const tdriveDebugState: TdriveDebugState = {};
const useDebugRecoilState = () => {
/**
@@ -17,7 +17,7 @@ const useDebugRecoilState = () => {
* @param {string} key - The key of the atom
* @returns {void}
*/
twakeDebugState.get = useRecoilCallback(
tdriveDebugState.get = useRecoilCallback(
({ snapshot }) =>
async (key: string) => {
const allNodes = Array.from(snapshot.getNodes_UNSTABLE());
@@ -35,7 +35,7 @@ const useDebugRecoilState = () => {
*
* @returns {void}
*/
twakeDebugState.dumpStateSnapshot = useRecoilCallback(
tdriveDebugState.dumpStateSnapshot = useRecoilCallback(
({ snapshot }) =>
async () => {
const result: Record<string, any> = {
@@ -58,7 +58,7 @@ const useDebugRecoilState = () => {
const link = document.createElement('a');
link.href = url;
link.download = `twake-state-${new Date().toISOString()}.json`;
link.download = `tdrive-state-${new Date().toISOString()}.json`;
link.click();
URL.revokeObjectURL(url);
@@ -71,7 +71,7 @@ const useDebugRecoilState = () => {
*
* @returns {void}
*/
twakeDebugState.getAllAtoms = useRecoilCallback(
tdriveDebugState.getAllAtoms = useRecoilCallback(
({ snapshot }) =>
async () => {
for (const node of snapshot.getNodes_UNSTABLE()) {
@@ -83,7 +83,7 @@ const useDebugRecoilState = () => {
[],
);
(window as any).twakeDebugState = twakeDebugState;
(window as any).tdriveDebugState = tdriveDebugState;
};
@@ -42,7 +42,7 @@ export default ({ children }: PropsType): React.ReactElement => {
if (!shouldTryDesktop) return;
setLoading(true);
try {
const path = window.location.href.replace(/^https?/, 'twake');
const path = window.location.href.replace(/^https?/, 'tdrive');
detectDesktopAppPresence(path).then(isDesktopAppPresent => {
setLoading(false);
if (isDesktopAppPresent) {
@@ -339,7 +339,7 @@ export default class DriveElement extends React.Component {
}
app = app.app;
DriveService.getFileUrlForEdition(
app.display?.twake?.files?.editor?.edition_url,
app.display?.tdrive?.files?.editor?.edition_url,
app,
this.state.element?.id,
url => {
@@ -116,7 +116,7 @@ export default class FilePicker extends Component {
)}{' '}
{directory.parent_id
? directory.name
: Languages.t('app.identity?.name.twake_drive', [], 'Documents')}
: Languages.t('app.identity?.name.tdrive_drive', [], 'Documents')}
</div>
<div className="drive_view list">
{directories.map((item, index) => (
@@ -55,13 +55,13 @@ const Emojione = React.memo((props: Props) => {
return <Icon type="trash" className="trash_emoji" />;
}
if (props.type.substr(0, 7) === ':twake-') {
if (props.type.substr(0, 7) === ':tdrive-') {
return (
<i
className={'emojione emoji-image ' + (props.className || '')}
style={{
backgroundImage:
"url('/public/img/twake-emoji/" + props.type.replace(/:/g, '') + ".png')",
"url('/public/img/tdrive-emoji/" + props.type.replace(/:/g, '') + ".png')",
}}
/>
);
@@ -36,7 +36,7 @@ export default (): React.ReactElement => {
<>
<Subtitle className="mt-4 block">Automatically invite my business</Subtitle>
<Info className="block">
If this is enabled, anyone creating a Twake account with your business email will
If this is enabled, anyone creating a Tdrive account with your business email will
automatically be added to this company and this workspace.
</Info>
<div className="flex flex-row space-x-2 mt-1 bg-zinc-200 px-3 py-2 rounded-md border-transparent w-full h-9">
@@ -1,6 +1,6 @@
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import Number from 'app/features/global/utils/Numbers';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
/**
* Menus manager service, choose where to generate menu
@@ -101,9 +101,9 @@ export default function MobileRedirect(props: { children: ReactNode }) {
<>
<div className="mobile_redirect_container">
<div className="open_on_mobile">
<span className="open_on_mobile_title">Open Twake in...</span>
<span className="open_on_mobile_title">Open Tdrive in...</span>
<a className="open_on_mobile_actions" href={backToWebUrl()}>
<Smartphone /> <span>Twake App</span>
<Smartphone /> <span>Tdrive App</span>
<span style={{ flex: 1 }}></span>
<Button className="action_button" type="primary">
Open
@@ -5,7 +5,7 @@ import Api from 'app/features/global/framework/api-service';
import Banner from 'app/components/banner/banner';
import Emojione from 'app/components/emojione/emojione';
import Languages from 'app/features/global/services/languages-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import ModalManager from 'app/components/modal/modal-manager';
import NewVersionModal from './new-version-modal';
import { ServerInfoType } from 'app/features/global/services/init-service';
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import ModalManager from 'app/components/modal/modal-manager';
import UserService from 'app/features/users/services/current-user-service';
import WelcomeOnTwake from './popups/welcome-on-twake';
import WelcomeOnTdrive from './popups/welcome-on-tdrive';
import DepreciatedCollections from 'app/deprecated/CollectionsV1/Collections/Collections.js';
import InitService from 'app/features/global/services/init-service';
import Groups from 'app/deprecated/workspaces/groups.js';
@@ -46,7 +46,7 @@ const CompanyStatusComponent = (): JSX.Element => {
if (isNewUser) {
localStorage.setItem(`onboarding_${companyId}`, 'completed');
return ModalManager.open(<WelcomeOnTwake email={user.email} />, {
return ModalManager.open(<WelcomeOnTdrive email={user.email} />, {
position: 'center',
size: { width: '600px' },
});
@@ -1,6 +1,6 @@
import emojis_json from 'emojione/emoji.json';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import { emojiIndex } from 'emoji-mart';
class Emojis {
@@ -35,7 +35,7 @@ const resolver = (
getCompanyApplications(Groups.currentGroupId).forEach((app: Application) => {
if (app) {
commands = commands.concat(
(app.display?.twake?.chat?.commands || []).map(c => ({
(app.display?.tdrive?.chat?.commands || []).map(c => ({
command: `/${app?.identity?.code} ${c.command}`,
description: c.description,
})),
@@ -33,9 +33,9 @@ export default (props: { driveItem: DriveItem & { user?: UserType } }) => {
const currentWorkspaceId = useRouterWorkspace();
const companyApplications = useCompanyApplications();
const [_, setParentId] = useRecoilState(DriveCurrentFolderAtom('root'));
const twakeDriveApplicationId =
const tdriveDriveApplicationId =
companyApplications.applications.find(application => {
return application.identity.code === 'twake_drive';
return application.identity.code === 'tdrive_drive';
})?.id || '';
const file = props.driveItem;
const name = file?.name;
@@ -96,7 +96,7 @@ export default (props: { driveItem: DriveItem & { user?: UserType } }) => {
theme="outline"
className="w-9 px-1.5 ml-2 rounded-full border-none"
onClick={() => {
openDriveItem(file, currentWorkspaceId, twakeDriveApplicationId);
openDriveItem(file, currentWorkspaceId, tdriveDriveApplicationId);
setParentId(file.parent_id);
setOpen(false);
}}
@@ -89,7 +89,7 @@ export const DynamicComponent = ({
if (url.indexOf('?') > 0) {
separator = '&';
}
url += separator + 'twake_user=' + UserService.getCurrentUser().id;
url += separator + 'tdrive_user=' + UserService.getCurrentUser().id;
}
return (
// eslint-disable-next-line react/jsx-no-target-blank
@@ -3,7 +3,7 @@ import Number from 'app/features/global/utils/Numbers';
import DriveService from 'app/deprecated/Apps/Drive/Drive.js';
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections.js';
import Resumable from 'app/features/files/utils/resumable.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import Api from 'app/features/global/framework/api-service';
import JWTStorage from 'app/features/auth/jwt-storage-service';
@@ -1,6 +1,6 @@
import Languages from 'app/features/global/services/languages-service';
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections.js';
import MediumPopupManager from 'app/components/modal/modal-manager';
import Workspaces from 'app/deprecated/workspaces/workspaces.jsx';
@@ -8,7 +8,7 @@ import { getCompanyApplications } from 'app/features/applications/state/company-
import Groups from 'app/deprecated/workspaces/groups.js';
import _ from 'lodash';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class Drive extends Observable {
constructor() {
@@ -521,23 +521,23 @@ class Drive extends Observable {
const apps = getCompanyApplications(Groups.currentGroupId).filter(
app =>
app.display?.twake?.files?.editor?.preview_url ||
app.display?.twake?.files?.editor?.edition_url,
app.display?.tdrive?.files?.editor?.preview_url ||
app.display?.tdrive?.files?.editor?.edition_url,
);
//Primary exts
apps.forEach(app => {
if (
(app.display?.twake?.files?.editor?.extensions || []).indexOf(
(app.display?.tdrive?.files?.editor?.extensions || []).indexOf(
((current.extension || '') + (current.url ? '.url' : '')).toLocaleLowerCase(),
) >= 0
) {
if (app.display?.twake?.files?.editor?.edition_url) {
if (app.display?.tdrive?.files?.editor?.edition_url) {
editor_candidate.push({ app });
}
if (app.display?.twake?.files?.editor?.preview_url) {
if (app.display?.tdrive?.files?.editor?.preview_url) {
preview_candidate.push({
url: app.display?.twake?.files?.editor?.preview_url,
url: app.display?.tdrive?.files?.editor?.preview_url,
app: app,
});
}
@@ -587,16 +587,16 @@ class Drive extends Observable {
//Secondary ext
apps.forEach(app => {
if (
(app.display?.twake?.files?.editor?.extensions || []).indexOf(
(app.display?.tdrive?.files?.editor?.extensions || []).indexOf(
((current.extension || '') + (current.url ? '.url' : '')).toLocaleLowerCase(),
) >= 0
) {
if (app.display?.twake?.files?.editor?.edition_url) {
if (app.display?.tdrive?.files?.editor?.edition_url) {
editor_candidate.push({ app });
}
if (app.display?.twake?.files?.editor?.preview_url) {
if (app.display?.tdrive?.files?.editor?.preview_url) {
preview_candidate.push({
url: app.display?.twake?.files?.editor?.preview_url,
url: app.display?.tdrive?.files?.editor?.preview_url,
app: app,
});
}
@@ -1,5 +1,5 @@
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections.js';
import MediumPopupManager from 'app/components/modal/modal-manager';
import Workspaces from 'app/deprecated/workspaces/workspaces.jsx';
@@ -5,7 +5,7 @@ import sha256 from 'crypto-js/sha256';
/** SecuredConnection
* Create websockets encrypted connection
*/
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
export default class SecuredConnection {
constructor(route, options, callback, http_options, collectionId) {
@@ -1,6 +1,6 @@
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class ConfiguratorsManager extends Observable {
constructor() {
@@ -1,6 +1,6 @@
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class SelectionsManager extends Observable {
constructor() {
@@ -5,7 +5,7 @@ import Login from '../../features/auth/login-service';
import { getUser } from '../../features/users/hooks/use-user-list';
/**
* This service is depreciated as Twake will exclusively use Console in the future
* This service is depreciated as Tdrive will exclusively use Console in the future
*/
class Account {
notify() {
@@ -2,7 +2,7 @@ import Observable from 'app/deprecated/CollectionsV1/observable.js';
import MenusManager from 'app/components/menus/menus-manager.jsx';
import WindowService from 'app/features/global/utils/window';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class PopupService extends Observable {
constructor() {
@@ -11,7 +11,7 @@ import DriveService from 'app/deprecated/Apps/Drive/Drive.js';
import CalendarService from 'app/deprecated/Apps/Calendar/Calendar.js';
import TasksService from 'app/deprecated/Apps/Tasks/Tasks.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class SearchService extends Observable {
constructor() {
@@ -1,6 +1,6 @@
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class UploadManager extends Observable {
constructor() {
@@ -10,7 +10,7 @@ import Number from 'app/features/global/utils/Numbers';
import AlertManager from 'app/features/global/services/alert-manager-service';
import Languages from 'app/features/global/services/languages-service';
import JWTStorage from 'app/features/auth/jwt-storage-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import { useCurrentUser } from 'app/features/users/hooks/use-current-user';
import UserAPIClient from '../../features/users/api/user-api-client';
import { getUser } from 'app/features/users/hooks/use-user-list';
@@ -6,7 +6,7 @@ import Login from 'app/features/auth/login-service';
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections.js';
import AlertManager from 'app/features/global/services/alert-manager-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
/**
* FIXME: This service seems still used by some components but we now have ./NotificationPreferences one which seems to overlap...
@@ -2,7 +2,7 @@ import Number from 'app/features/global/utils/Numbers';
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import LoginService from 'app/features/auth/login-service';
import Logger from 'app/features/global/framework/logger-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import WebSocket from '../../features/global/types/websocket-types';
/**
@@ -9,7 +9,7 @@ import $ from 'jquery';
import JWTStorage from 'app/features/auth/jwt-storage-service';
import CompanyAPIClient from '../../features/companies/api/company-api-client';
import UserService from 'app/features/users/services/current-user-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class Groups extends Observable {
constructor() {
@@ -10,7 +10,7 @@ import ConsoleService from 'app/features/console/services/console-service';
import Api from 'app/features/global/framework/api-service';
import LocalStorage from 'app/features/global/framework/local-storage-service';
import Logger from 'app/features/global/framework/logger-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import WindowService from 'app/features/global/utils/window';
import RouterServices from 'app/features/router/services/router-service';
import workspacesUsers from 'app/features/workspace-members/services/workspace-members-service';
@@ -6,7 +6,7 @@ import ws from 'app/deprecated/websocket/websocket.js';
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections.js';
import Groups from './groups.js';
import Workspaces from './workspaces.jsx';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import Icon from 'app/components/icon/icon';
import { getUser } from 'app/features/users/hooks/use-user-list';
import Login from 'app/features/auth/login-service';
@@ -218,11 +218,11 @@ class WorkspacesApps extends Observable {
getAppIcon(app, feather = false) {
if (app && app?.identity?.code) {
switch (app?.identity?.code.toLocaleLowerCase()) {
case 'twake_calendar':
case 'tdrive_calendar':
return feather ? Calendar : 'calendar-alt';
case 'twake_drive':
case 'tdrive_drive':
return feather ? Folder : 'folder';
case 'twake_tasks':
case 'tdrive_tasks':
return feather ? CheckSquare : 'check-square';
default:
return app.identity?.icon || (feather ? Hexagon : 'puzzle-piece');
@@ -4,18 +4,18 @@ export default {
front_root_url: (document.location.protocol || "http") + '//' + document.location.host,
api_root_url: (document.location.protocol || "http") + '//' + document.location.host,
websocket_url: (document.location.protocol || "http").replace("http", "ws") + '//' + document.location.host,
mobile_appstore: 'https://apps.apple.com/fr/app/twake/id1588764852?l=en',
mobile_googleplay: 'https://play.google.com/store/apps/details?id=com.twake.twake&gl=FR'
mobile_appstore: 'https://apps.apple.com/fr/app/tdrive/id1588764852?l=en',
mobile_googleplay: 'https://play.google.com/store/apps/details?id=com.tdrive.tdrive&gl=FR'
};
/*
export default {
env_dev: false,
front_root_url: 'https://web.twake.app',
api_root_url: 'https://api.twake.app',
websocket_url: 'wss://api.twake.app'
front_root_url: 'https://web.tdrive.app',
api_root_url: 'https://api.tdrive.app',
websocket_url: 'wss://api.tdrive.app'
};
In this form:
"export default { env_dev: false, front_root_url: 'https://web.twake.app', api_root_url: 'https://web.twake.app', websocket_url: 'wss://web.twake.app' };"
"export default { env_dev: false, front_root_url: 'https://web.tdrive.app', api_root_url: 'https://web.tdrive.app', websocket_url: 'wss://web.tdrive.app' };"
*/
@@ -1,12 +1,12 @@
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { Application } from 'app/features/applications/types/application';
type DeleteApplicationResponse = {
status: 'success' | 'error';
};
@TwakeService('ApplicationsAPIClientService')
@TdriveService('ApplicationsAPIClientService')
class ApplicationsAPIClientService {
prefix = '/internal/services/applications/v1/applications';
/**
@@ -1,11 +1,11 @@
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { Application } from 'app/features/applications/types/application';
import { WebsocketRoom } from '../../global/types/websocket-types';
const PREFIX = '/internal/services/applications/v1/companies';
@TwakeService('CompanyApplicationsAPIClientService')
@TdriveService('CompanyApplicationsAPIClientService')
class CompanyApplicationsAPIClient {
private realtime: Map<string, WebsocketRoom[]> = new Map();
@@ -4,30 +4,30 @@ export const replaceOnlyOfficeForCanary = (applications: Application[]) => {
return applications.map(application => {
if (
application?.identity?.code === 'only_office' &&
!application.display?.twake?.files?.editor?.preview_url?.includes('plugins.twake.app')
!application.display?.tdrive?.files?.editor?.preview_url?.includes('plugins.tdrive.app')
) {
return {
...application,
display: {
twake: {
tdrive: {
version: 1,
files: {
editor: {
preview_url: 'https://plugins.twake.app/plugins/onlyoffice/?preview=1',
edition_url: 'https://plugins.twake.app/plugins/onlyoffice/',
preview_url: 'https://plugins.tdrive.app/plugins/onlyoffice/?preview=1',
edition_url: 'https://plugins.tdrive.app/plugins/onlyoffice/',
empty_files: [
{
url: 'https://plugins.twake.app/plugins/onlyoffice/assets/empty.docx',
url: 'https://plugins.tdrive.app/plugins/onlyoffice/assets/empty.docx',
filename: 'Untitled.docx',
name: 'ONLYOFFICE Word Document',
},
{
url: 'https://plugins.twake.app/plugins/onlyoffice/assets/empty.xlsx',
url: 'https://plugins.tdrive.app/plugins/onlyoffice/assets/empty.xlsx',
filename: 'Untitled.xlsx',
name: 'ONLYOFFICE Excel Document',
},
{
url: 'https://plugins.twake.app/plugins/onlyoffice/assets/empty.pptx',
url: 'https://plugins.tdrive.app/plugins/onlyoffice/assets/empty.pptx',
filename: 'Untitled.pptx',
name: 'ONLYOFFICE PowerPoint Document',
},
@@ -16,7 +16,7 @@ class Application {
}
/**
* Start the Twake application: Starting all the required services for the given user
* Start the Tdrive application: Starting all the required services for the given user
*/
async start(user: UserType): Promise<void> {
if (this.started) {
@@ -1,6 +1,6 @@
/**
* DEPRECATED
* We should remove this when we are sure that new application format is implemented everywhere in Twake
* We should remove this when we are sure that new application format is implemented everywhere in Tdrive
*/
export type AppType = { [key: string]: unknown };
@@ -111,7 +111,7 @@ export type StandalonePlugin = {
};
export type ApplicationDisplay = {
twake?: {
tdrive?: {
version?: number;
/**
@@ -25,7 +25,7 @@ const defaultApplicationPayload: Application = {
hooks: [],
},
display: {
twake: {
tdrive: {
version: 1,
files: {
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
import InitService, {
ConsoleConfiguration,
InternalConfiguration,
@@ -18,7 +18,7 @@ import JWT, { JWTDataType } from 'app/features/auth/jwt-storage-service';
import UserAPIClient from '../../features/users/api/user-api-client';
import Application from 'app/features/applications/services/application-service';
import LocalStorage from 'app/features/global/framework/local-storage-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
type AccountType = 'remote' | 'internal';
export type LoginState =
@@ -32,7 +32,7 @@ export type LoginState =
| 'logout';
type InitState = '' | 'initializing' | 'initialized';
@TwakeService('AuthService')
@TdriveService('AuthService')
class AuthService {
private provider: AuthProvider<any, any, any> | null = null;
private logger: Logger.Logger;
@@ -3,7 +3,7 @@ import LocalStorage from 'app/features/global/framework/local-storage-service';
import LoginService from 'app/features/auth/login-service';
import WindowService from 'app/features/global/utils/window';
import ConsoleAPIClient from 'app/features/console/api/console-api-client';
import { TwakeService } from '../global/framework/registry-decorator-service';
import { TdriveService } from '../global/framework/registry-decorator-service';
import Logger from '../global/framework/logger-service';
export type JWTDataType = {
@@ -20,7 +20,7 @@ if ((WindowService.findGetParameter('mobile_login') as any) === '1') {
LocalStorage.setItem('mobile_login', '1');
}
@TwakeService('JWTStorageService')
@TdriveService('JWTStorageService')
class JWTStorage {
private timeDelta = 5 * 60;
private jwtData: JWTDataType = {
@@ -3,7 +3,7 @@
import Logger from 'app/features/global/framework/logger-service';
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import WindowState from 'app/features/global/utils/window';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import RouterServices from '../router/services/router-service';
import LocalStorage from 'app/features/global/framework/local-storage-service';
import AuthService from 'app/features/auth/auth-service';
@@ -1,9 +1,9 @@
import Logger from 'app/features/global/framework/logger-service';
import { InternalConfiguration } from '../../../global/services/init-service';
import Observable from '../../../../deprecated/Observable/Observable';
import { TwakeService } from '../../../global/framework/registry-decorator-service';
import { TdriveService } from '../../../global/framework/registry-decorator-service';
import { AuthProvider, InitParameters } from '../auth-provider';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import RouterService from 'app/features/router/services/router-service';
import ConsoleAPIClient from 'app/features/console/api/console-api-client';
@@ -25,7 +25,7 @@ export type SignOutParameters = {
reload: boolean;
};
@TwakeService('InternalAuthProvider')
@TdriveService('InternalAuthProvider')
export default class InternalAuthProviderService
extends Observable
implements AuthProvider<SignInParameters, SignOutParameters, SignUpParameters>
@@ -5,7 +5,7 @@ import { ConsoleConfiguration } from '../../../global/services/init-service';
import Observable from '../../../../deprecated/Observable/Observable';
import Logger from 'app/features/global/framework/logger-service';
import { getAsFrontUrl } from 'app/features/global/utils/URLUtils';
import { TwakeService } from '../../../global/framework/registry-decorator-service';
import { TdriveService } from '../../../global/framework/registry-decorator-service';
import EnvironmentService from '../../../global/framework/environment-service';
import { AuthProvider, InitParameters } from '../auth-provider';
import ConsoleService from 'app/features/console/services/console-service';
@@ -16,7 +16,7 @@ const OIDC_CALLBACK_URL = '/oidccallback';
const OIDC_SIGNOUT_URL = '/signout';
const OIDC_SILENT_URL = '/oidcsilent';
@TwakeService('OIDCAuthProvider')
@TdriveService('OIDCAuthProvider')
export default class OIDCAuthProviderService
extends Observable
implements AuthProvider<unknown, unknown, unknown>
@@ -1,6 +1,6 @@
import { ChannelMemberType } from 'app/features/channel-members-search/types/channel-members';
import Api from 'app/features/global/framework/api-service';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
import { WebsocketRoom } from 'app/features/global/types/websocket-types';
import {
ParamsChannelMember,
@@ -9,7 +9,7 @@ import {
ResponseChannelMemberTypeList,
} from '../types/channel-members';
@TwakeService('ChannelMemberAPIClientService')
@TdriveService('ChannelMemberAPIClientService')
class ChannelMembersApiClient {
private readonly apiBaseUrl: string = '/internal/services/channels/v1/companies';
private _realtime: WebsocketRoom = { room: '', token: '' };
@@ -1,8 +1,8 @@
import Api from "app/features/global/framework/api-service";
import { TwakeService } from "app/features/global/framework/registry-decorator-service";
import { TdriveService } from "app/features/global/framework/registry-decorator-service";
import { ChannelPendingEmail, ChannelPendingEmailResponse, ParamsChannelMember, PayloadChannelPendingEmail, ResponseChannelPendingEmail, ResponseDeletePendingEmailResponse } from "../types/channel-members";
@TwakeService('ChannelPendingEmailMemberAPIClientService')
@TdriveService('ChannelPendingEmailMemberAPIClientService')
class ChannelPendingEmailApiClient {
private readonly apiBaseUrl: string = '/internal/services/channels/v1/companies';
@@ -1,5 +1,5 @@
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import {
ChannelMemberRole,
ChannelMemberType,
@@ -10,7 +10,7 @@ import { ChannelMemberReadSectionType } from '../types/channel-member-read-secti
type ChannelMembersSaveRequest = { resource: Partial<ChannelMemberType> };
type ChannelMembersSaveResponse = { resource: ChannelMemberType };
@TwakeService('ChannelMembersAPIClientService')
@TdriveService('ChannelMembersAPIClientService')
class ChannelCurrentMemberAPIClientService {
private readonly prefix = '/internal/services/channels/v1/companies';
private realtime: Map<
@@ -1,6 +1,6 @@
import Api from '../../global/framework/api-service';
import { ChannelType } from 'app/features/channels/types/channel';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { delayRequest } from 'app/features/global/utils/managedSearchRequest';
import { removeBadgesNow } from 'app/features/users/hooks/use-notifications';
@@ -14,7 +14,7 @@ export type SearchOptions = {
limit?: number;
};
@TwakeService('ChannelAPIClientService')
@TdriveService('ChannelAPIClientService')
class ChannelAPIClientService {
private logger = Logger.getLogger('ChannelAPIClientService');
@@ -1,6 +1,6 @@
import Api from '../../global/framework/api-service';
import { ChannelType } from 'app/features/channels/types/channel';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { WebsocketRoom } from '../../global/types/websocket-types';
type ChannelsMineGetResponse = { resources: ChannelType[]; websockets: WebsocketRoom[] };
@@ -10,7 +10,7 @@ type ChannelsMineDeleteBaseResponse = {
message: string;
};
@TwakeService('ChannelsMineAPIClientService')
@TdriveService('ChannelsMineAPIClientService')
class ChannelsMineAPIClient {
private readonly prefix = '/internal/services/channels/v1/companies';
private readonly realtime: Map<string, WebsocketRoom[]> = new Map();
@@ -5,10 +5,10 @@ import {
} from 'app/features/channels/types/channels-reachable-types';
import Api from '../../global/framework/api-service';
import { ChannelType } from 'app/features/channels/types/channel';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { ChannelMemberType } from 'app/features/channel-members/types/channel-member-types';
@TwakeService('ChannelsReachableAPIClientService')
@TdriveService('ChannelsReachableAPIClientService')
class ChannelsReachableAPIClientService {
private readonly prefix = '/internal/services/channels/v1/companies';
@@ -1,7 +1,7 @@
import { CompanyType } from 'app/features/companies/types/company';
import { WorkspaceType } from 'app/features/workspaces/types/workspace';
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { WebsocketRoom } from '../../global/types/websocket-types';
const PREFIX = '/internal/services/users/v1';
@@ -12,7 +12,7 @@ export type UpdateWorkspaceBody = {
resource: WorkspaceUpdateResource;
};
@TwakeService('CompanyAPIClientService')
@TdriveService('CompanyAPIClientService')
class CompanyAPIClient {
private realtime: Map<string, WebsocketRoom> = new Map();
@@ -26,7 +26,7 @@ export type CompanyStatsObjectType = {
total_members: number;
total_guests: number;
total_messages: number;
//Will be completed with Twake specific stats
//Will be completed with Tdrive specific stats
};
export type CompanyPlanObjectType = {
@@ -1,5 +1,5 @@
import Api from 'app/features/global/framework/api-service';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
import JWTStorage, { JWTDataType } from 'app/features/auth/jwt-storage-service';
type LoginParams = {
@@ -16,7 +16,7 @@ type SignupParams = {
username: string;
};
@TwakeService('ConsoleAPIClientService')
@TdriveService('ConsoleAPIClientService')
class ConsoleAPIClient {
login(params: LoginParams, disableJWTAuthentication = false): Promise<string> {
return Api.post<LoginParams, { access_token: string }>(
@@ -1,9 +1,9 @@
import Api from '../../global/framework/api-service';
import { DriveTwakeTab } from '../types';
import { DriveTdriveTab } from '../types';
export class DriveTwakeApiClient {
export class DriveTdriveApiClient {
static async getTab(companyId: string, tabId: string) {
return await Api.get<DriveTwakeTab>(
return await Api.get<DriveTdriveTab>(
`/internal/services/documents/v1/companies/${companyId}/tabs/${tabId}`,
);
}
@@ -15,7 +15,7 @@ export class DriveTwakeApiClient {
itemId: string,
level: 'write' | 'read',
) {
return await Api.post<DriveTwakeTab, DriveTwakeTab>(
return await Api.post<DriveTdriveTab, DriveTdriveTab>(
`/internal/services/documents/v1/companies/${companyId}/tabs/${tabId}`,
{
company_id: companyId,
@@ -1,17 +1,17 @@
import useRouterCompany from 'app/features/router/hooks/use-router-company';
import { useEffect, useState } from 'react';
import { useRecoilState } from 'recoil';
import { DriveTwakeApiClient } from '../api-client/api-client';
import { DriveTwakeTabAtom } from '../state/store';
import { DriveTdriveApiClient } from '../api-client/api-client';
import { DriveTdriveTabAtom } from '../state/store';
export const useDriveTwakeTab = (channelId: string, tabId: string) => {
export const useDriveTdriveTab = (channelId: string, tabId: string) => {
const companyId = useRouterCompany();
const [tab, setTab] = useRecoilState(DriveTwakeTabAtom(tabId));
const [tab, setTab] = useRecoilState(DriveTdriveTabAtom(tabId));
const [loading, setLoading] = useState(false);
useEffect(() => {
setLoading(true);
DriveTwakeApiClient.getTab(companyId, tabId)
DriveTdriveApiClient.getTab(companyId, tabId)
.then(setTab)
.finally(() => setLoading(false));
}, [companyId, tabId]);
@@ -20,7 +20,7 @@ export const useDriveTwakeTab = (channelId: string, tabId: string) => {
tab,
setTab: async (itemId: string, level: 'read' | 'write') => {
setLoading(true);
const tab = await DriveTwakeApiClient.setTab(companyId, tabId, channelId, itemId, level);
const tab = await DriveTdriveApiClient.setTab(companyId, tabId, channelId, itemId, level);
if (tab.item_id) setTab(tab);
setLoading(false);
},
@@ -0,0 +1,7 @@
import { atomFamily } from 'recoil';
import { DriveTdriveTab } from '../types';
export const DriveTdriveTabAtom = atomFamily<DriveTdriveTab | null, string>({
key: 'DriveTdriveTabAtom',
default: () => null,
});
@@ -1,4 +1,4 @@
export type DriveTwakeTab = {
export type DriveTdriveTab = {
company_id: string;
tab_id: string;
channel_id: string;
@@ -1,7 +0,0 @@
import { atomFamily } from 'recoil';
import { DriveTwakeTab } from '../types';
export const DriveTwakeTabAtom = atomFamily<DriveTwakeTab | null, string>({
key: 'DriveTwakeTabAtom',
default: () => null,
});
@@ -18,22 +18,22 @@ export type SearchDocumentsBody = {
};
let publicLinkToken: null | string = null;
let twakeTabToken: null | string = null;
let tdriveTabToken: null | string = null;
export const setPublicLinkToken = (token: string | null) => {
publicLinkToken = token;
};
export const setTwakeTabToken = (token: string | null) => {
twakeTabToken = token;
export const setTdriveTabToken = (token: string | null) => {
tdriveTabToken = token;
};
const appendPublicAndTwakeToken = (useAnd?: boolean) => {
const appendPublicAndTdriveToken = (useAnd?: boolean) => {
if (publicLinkToken) {
return `${useAnd ? '&' : '?'}public_token=${publicLinkToken}`;
}
if (twakeTabToken) {
return `${useAnd ? '&' : '?'}twake_tab_token=${twakeTabToken}`;
if (tdriveTabToken) {
return `${useAnd ? '&' : '?'}tdrive_tab_token=${tdriveTabToken}`;
}
return '';
};
@@ -42,19 +42,19 @@ export class DriveApiClient {
private static logger = Logger.getLogger('MessageAPIClientService');
static async get(companyId: string, id: string | 'trash' | '') {
return await Api.get<DriveItemDetails>(
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendPublicAndTwakeToken()}`,
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendPublicAndTdriveToken()}`,
);
}
static async remove(companyId: string, id: string | 'trash' | '') {
return await Api.delete<void>(
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendPublicAndTwakeToken()}`,
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendPublicAndTdriveToken()}`,
);
}
static async update(companyId: string, id: string, update: Partial<DriveItem>) {
return await Api.post<Partial<DriveItem>, DriveItem>(
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendPublicAndTwakeToken()}`,
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendPublicAndTdriveToken()}`,
update,
);
}
@@ -68,14 +68,14 @@ export class DriveApiClient {
{ item: Partial<DriveItem>; version: Partial<DriveItemVersion> },
DriveItem
>(
`/internal/services/documents/v1/companies/${companyId}/item${appendPublicAndTwakeToken()}`,
`/internal/services/documents/v1/companies/${companyId}/item${appendPublicAndTdriveToken()}`,
data as { item: Partial<DriveItem>; version: Partial<DriveItemVersion> },
);
}
static async createVersion(companyId: string, id: string, version: Partial<DriveItemVersion>) {
return await Api.post<Partial<DriveItemVersion>, DriveItemVersion>(
`/internal/services/documents/v1/companies/${companyId}/item/${id}/version${appendPublicAndTwakeToken()}`,
`/internal/services/documents/v1/companies/${companyId}/item/${id}/version${appendPublicAndTdriveToken()}`,
version,
);
}
@@ -84,7 +84,7 @@ export class DriveApiClient {
return Api.get<{ token: string }>(
`/internal/services/documents/v1/companies/${companyId}/item/download/token` +
`?items=${ids.join(',')}&version_id=${versionId}` +
appendPublicAndTwakeToken(true),
appendPublicAndTdriveToken(true),
);
}
@@ -92,12 +92,12 @@ export class DriveApiClient {
const { token } = await DriveApiClient.getDownloadToken(companyId, [id], versionId);
if (versionId)
return Api.route(
`/internal/services/documents/v1/companies/${companyId}/item/${id}/download?version_id=${versionId}&token=${token}${appendPublicAndTwakeToken(
`/internal/services/documents/v1/companies/${companyId}/item/${id}/download?version_id=${versionId}&token=${token}${appendPublicAndTdriveToken(
true,
)}`,
);
return Api.route(
`/internal/services/documents/v1/companies/${companyId}/item/${id}/download?token=${token}${appendPublicAndTwakeToken(
`/internal/services/documents/v1/companies/${companyId}/item/${id}/download?token=${token}${appendPublicAndTdriveToken(
true,
)}`,
);
@@ -108,7 +108,7 @@ export class DriveApiClient {
return Api.route(
`/internal/services/documents/v1/companies/${companyId}/item/download/zip` +
`?items=${ids.join(',')}&token=${token}` +
appendPublicAndTwakeToken(true),
appendPublicAndTdriveToken(true),
);
}
@@ -53,7 +53,7 @@ export type DriveItemVersion = {
id: string;
//The file itself, using the existing new node "file" entity
provider: string | 'drive' | 'internal'; //Equivalent to "source" in twake/backend/node/src/services/messages/entities/message-files.ts
provider: string | 'drive' | 'internal'; //Equivalent to "source" in tdrive/backend/node/src/services/messages/entities/message-files.ts
drive_item_id: string;
file_metadata: FileMetadata; //New field
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-explicit-any */
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import Requests from 'app/features/global/framework/requests-api-service';
class GroupedQueryApi {
@@ -1,5 +1,5 @@
export default class LocalStorage {
static prefix = 'twake:';
static prefix = 'tdrive:';
static setItem(key: string, value: unknown) {
window.localStorage.setItem(`${LocalStorage.prefix}${key}`, JSON.stringify(value));
@@ -28,7 +28,7 @@ export default class LocalStorage {
if (key) {
const depreciatedKeysRemove =
[
'twake-collections-db',
'tdrive-collections-db',
'm_input',
'language',
'jwt',
@@ -3,8 +3,8 @@ import ServiceRegistry from 'app/features/global/framework/registry-service';
const SERVICE_SUFFIX = 'ChannelServiceImpl';
export function TwakeService(name: string): ClassDecorator {
return function DecoratedTwakeService(target: any): any {
export function TdriveService(name: string): ClassDecorator {
return function DecoratedTdriveService(target: any): any {
const originalConstrutor = target;
const decorated: any = function (...args: any) {
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { Maybe } from 'app/features/global/types/global-types';
import Globals from '../services/globals-twake-app-service';
import Globals from '../services/globals-tdrive-app-service';
import JWTStorage from '../../auth/jwt-storage-service';
import Logger from '../framework/logger-service';
@@ -2,7 +2,7 @@
import { useEffect } from 'react';
import { useCurrentUser } from 'app/features/users/hooks/use-current-user';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import Logger from 'app/features/global/framework/logger-service';
let initiatedService = false;
@@ -2,7 +2,7 @@
import { Modal } from 'antd';
import Languages from 'app/features/global/services/languages-service';
import { TwakeService } from '../framework/registry-decorator-service';
import { TdriveService } from '../framework/registry-decorator-service';
const { confirm, info } = Modal;
@@ -10,7 +10,7 @@ type Options = {
title?: string;
text?: string;
};
@TwakeService('Alert')
@TdriveService('Alert')
class AlertServiceService {
alert(onClose: () => void, options?: Options) {
info({
@@ -24,7 +24,7 @@ availableFeaturesWithDefaults.set(FeatureNames.UNLIMITED_STORAGE, true);
availableFeaturesWithDefaults.set(FeatureNames.COMPANY_INVITE_MEMBER, true);
/**
* ChannelServiceImpl that allow you to manage feature flipping in Twake using react feature toggles
* ChannelServiceImpl that allow you to manage feature flipping in Tdrive using react feature toggles
*/
class FeatureTogglesService {
public activeFeatureNames: FeatureNames[];
@@ -31,7 +31,7 @@ document.body.addEventListener('dragover', e => e.preventDefault());
document.body.addEventListener('dragenter', e => e.preventDefault());
document.body.addEventListener('drop', e => e.preventDefault());
class TwakeApp {
class TdriveApp {
window: Window;
environment: EnvironmentType;
store_public_access_get_data: any;
@@ -67,6 +67,6 @@ class TwakeApp {
}
}
const app = new TwakeApp();
(window as any).TwakeApp = app;
const app = new TdriveApp();
(window as any).TdriveApp = app;
export default app;
@@ -6,7 +6,7 @@ import Collections from 'app/deprecated/CollectionsV1/Collections/Collections.js
import PseudoMarkdownDictionary from 'components/twacode/pseudo-markdown-dictionary';
import anchorme from 'anchorme';
import emojis_original_service from 'emojione';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class PseudoMarkdownCompiler {
saved_messages: { [key: string]: any } = {};
@@ -1,4 +1,4 @@
import Globals from './globals-twake-app-service';
import Globals from './globals-tdrive-app-service';
import Logger from '../framework/logger-service';
import JWT from '../../auth/jwt-storage-service';
import WebSocketService, { WebSocketOptions } from './websocket-service';
@@ -1,5 +1,5 @@
import environment from 'app/environment/environment';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
export function addApiUrlIfNeeded(url: string, asCssUrl?: boolean): string {
function _wrap(url: string): string {
@@ -7,7 +7,7 @@ import 'moment/locale/es';
import Observable from 'app/deprecated/CollectionsV1/observable.js';
import UserService from 'app/features/users/services/current-user-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class DateTime extends Observable {
constructor() {
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { capitalize } from 'lodash';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
class WindowState {
public readonly app_name: string = 'Tdrive';
@@ -1,5 +1,5 @@
import Api from 'app/features/global/framework/api-service';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
import { InvitationType as InvitationRoleType, InvitedUser } from '../state/invitation';
import Logger from 'app/features/global/framework/logger-service';
@@ -30,7 +30,7 @@ type WorkspaceInvitationTokenPayloadType = {
channels: string[];
};
@TwakeService('InvitationApiClientService')
@TdriveService('InvitationApiClientService')
class InvitationApiClient {
private readonly apiBaseUrl: string = '/internal/services/workspaces/v1/companies';
logger: Logger.Logger;
@@ -1,4 +1,4 @@
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import {
Message,
MessageExtended,
@@ -40,7 +40,7 @@ export interface FileSearchOptions extends BaseSearchOptions {
next_page_token?: string;
}
@TwakeService('MessageAPIClientService')
@TdriveService('MessageAPIClientService')
class MessageAPIClient {
private readonly prefixUrl: string = '/internal/services/messages/v1';
private realtime: Map<string, WebsocketRoom[]> = new Map();
@@ -5,12 +5,12 @@ import {
MessageWithReplies,
} from 'app/features/messages/types/message';
import Api from 'app/features/global/framework/api-service';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
/**
* This service is to create and update a thread
*/
@TwakeService('MessageThreadAPIClient')
@TdriveService('MessageThreadAPIClient')
class MessageThreadAPIClient {
private readonly prefixUrl: string = '/internal/services/messages/v1';
@@ -1,5 +1,5 @@
import { MessageWithReplies } from 'app/features/messages/types/message';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
import Api from 'app/features/global/framework/api-service';
import { WebsocketRoom } from 'app/features/global/types/websocket-types';
import Numbers from 'app/features/global/utils/Numbers';
@@ -12,7 +12,7 @@ import Numbers from 'app/features/global/utils/Numbers';
* - my active threads view
* - ...
*/
@TwakeService('MessageViewAPIClientService')
@TdriveService('MessageViewAPIClientService')
class MessageViewAPIClient {
private readonly prefixUrl: string = '/internal/services/messages/v1';
private realtime: Map<string, WebsocketRoom[]> = new Map();
@@ -19,5 +19,5 @@ class MessageEditorServiceFactory {
}
const factory = new MessageEditorServiceFactory();
(window as any).TwakeMessageEditorServiceFactory = factory;
(window as any).TdriveMessageEditorServiceFactory = factory;
export default factory;
@@ -1,8 +1,8 @@
import { preferencesType, NotificationPreferencesType } from '../types/notifications-preferences';
import Api from 'app/features/global/framework/api-service';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
@TwakeService('NotificationsPreferencesAPIClientService')
@TdriveService('NotificationsPreferencesAPIClientService')
class NotificationsPreferencesAPIClientService {
private readonly apiUrl = '/internal/services/notifications/v1/preferences';
@@ -5,9 +5,9 @@ import {
SavePendingEmailRequest,
} from '../types/pending-email';
import Api from 'app/features/global/framework/api-service';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
@TwakeService('PendingEmailsAPIClientService')
@TdriveService('PendingEmailsAPIClientService')
class PendingEmailsAPIClientService {
private readonly prefix = '/internal/services/channels/v1/companies';
@@ -1,6 +1,6 @@
import { TabType } from 'app/features/tabs/types/tab';
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { WebsocketRoom } from '../../global/types/websocket-types';
type TabKey = {
@@ -9,7 +9,7 @@ type TabKey = {
channelId: string;
};
@TwakeService('TabsAPIClientService')
@TdriveService('TabsAPIClientService')
class TabsAPIClient {
private readonly prefixUrl: string = '/internal/services/channels/v1';
private realtime: Map<string, WebsocketRoom[]> = new Map();
@@ -2,7 +2,7 @@
import { CompanyType } from 'app/features/companies/types/company';
import { UserPreferencesType, UserType } from 'app/features/users/types/user';
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { WebsocketRoom } from '../../global/types/websocket-types';
import WorkspaceAPIClient from '../../workspaces/api/workspace-api-client';
import CurrentUser from '../../../deprecated/user/CurrentUser';
@@ -20,7 +20,7 @@ type SearchUserApiResponse<T> = {
resources: T[];
};
@TwakeService('UserAPIClientService')
@TdriveService('UserAPIClientService')
class UserAPIClientService {
private readonly prefixUrl: string = '/internal/services/users/v1';
private realtime: Map<string, WebsocketRoom> = new Map();
@@ -1,9 +1,9 @@
import Api from '../../global/framework/api-service';
import { NotificationType } from 'app/features/users/types/notification-types';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { WebsocketRoom } from 'app/features/global/types/websocket-types';
@TwakeService('UserNotificationAPIClientService')
@TdriveService('UserNotificationAPIClientService')
class UserNotificationAPIClient {
private realtime: WebsocketRoom = { room: '', token: '' };
@@ -5,7 +5,7 @@ import Collections, { Collection } from 'app/deprecated/CollectionsV1/Collection
import Api from 'app/features/global/framework/api-service';
import Languages from 'app/features/global/services/languages-service';
import { UserType } from 'app/features/users/types/user';
import { TwakeService } from 'app/features/global/framework/registry-decorator-service';
import { TdriveService } from 'app/features/global/framework/registry-decorator-service';
import { addApiUrlIfNeeded } from 'app/features/global/utils/URLUtils';
import { getUser } from '../hooks/use-user-list';
import { getGradient } from 'app/atoms/avatar';
@@ -17,7 +17,7 @@ type SearchQueryType = {
timeout_search?: ReturnType<typeof setTimeout>;
};
@TwakeService('UserServiceImpl')
@TdriveService('UserServiceImpl')
class User {
private users_repository: Collection;
private searchQueries: SearchQueryType;
@@ -3,7 +3,7 @@
import ws from 'app/deprecated/websocket/websocket';
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections';
import UserService from './current-user-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
import userAsyncGet from 'app/features/users/utils/async-get';
type Timeout = ReturnType<typeof setTimeout>;
@@ -2,7 +2,7 @@ import { ChannelType } from 'app/features/channels/types/channel';
import { MessageFileType, MessageWithReplies } from 'app/features/messages/types/message';
import { UserType } from 'app/features/users/types/user';
import Api from '../../global/framework/api-service';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
const MESSAGES_PREFIX = '/internal/services/messages/v1/companies';
@@ -22,7 +22,7 @@ export type MessageFileDetails = MessageFileType & {
};
};
@TwakeService('ViewerAPIClientService')
@TdriveService('ViewerAPIClientService')
class ViewerAPIClient {
async getMessageFile(companyId: string, messageId: string, msgFileId: string) {
const route = `${MESSAGES_PREFIX}/${companyId}/messages/${messageId}/files/${msgFileId}`;
@@ -3,11 +3,11 @@ import {
WorkspacePendingUserType,
WorkspaceUserType,
} from 'app/features/workspaces/types/workspace';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
const PREFIX = '/internal/services/workspaces/v1/companies';
@TwakeService('WorkspaceUserAPIClientService')
@TdriveService('WorkspaceUserAPIClientService')
class WorkspaceUserAPIClientService {
/**
* Get all workspace users
@@ -13,7 +13,7 @@ import Numbers from 'app/features/global/utils/Numbers';
import WorkspaceUserRights from 'app/features/workspaces/services/workspace-user-rights-service';
import CurrentUser from 'app/deprecated/user/CurrentUser';
import AlertManager from 'app/features/global/services/alert-manager-service';
import Globals from 'app/features/global/services/globals-twake-app-service';
import Globals from 'app/features/global/services/globals-tdrive-app-service';
const prefixRoute = '/internal/services/workspaces/v1';
@@ -1,7 +1,7 @@
import Api from '../../global/framework/api-service';
import { CompanyType } from 'app/features/companies/types/company';
import { WorkspaceType } from 'app/features/workspaces/types/workspace';
import { TwakeService } from '../../global/framework/registry-decorator-service';
import { TdriveService } from '../../global/framework/registry-decorator-service';
import { WebsocketRoom } from '../../global/types/websocket-types';
import _ from 'lodash';
@@ -21,7 +21,7 @@ type UpdateWorkspaceInviteDomainResponse = {
status: string;
}
@TwakeService('WorkspaceAPIClientService')
@TdriveService('WorkspaceAPIClientService')
class WorkspaceAPIClient {
private realtime: Map<string, WebsocketRoom[]> = new Map();
@@ -22,7 +22,7 @@ const Template: ComponentStory<any> = (props: {
avatar={
<Avatar
type="square"
avatar="https://s3.eu-west-3.amazonaws.com/twake.eu-west-3/public/uploads/grouplogo/dffc6bb54e7b5d6ee45d2d877839aa88.png"
avatar="https://s3.eu-west-3.amazonaws.com/tdrive.eu-west-3/public/uploads/grouplogo/dffc6bb54e7b5d6ee45d2d877839aa88.png"
/>
}
title="Linagora"
@@ -22,7 +22,7 @@ const Template: ComponentStory<any> = (props: {
avatar={
<Avatar
type="square"
avatar="https://s3.eu-west-3.amazonaws.com/twake.eu-west-3/public/uploads/grouplogo/dffc6bb54e7b5d6ee45d2d877839aa88.png"
avatar="https://s3.eu-west-3.amazonaws.com/tdrive.eu-west-3/public/uploads/grouplogo/dffc6bb54e7b5d6ee45d2d877839aa88.png"
/>
}
title="Home"
@@ -33,7 +33,7 @@ const Template: ComponentStory<any> = (props: {
avatar={
<Avatar
type="square"
avatar="https://s3.eu-west-3.amazonaws.com/twake.eu-west-3/public/uploads/wslogo/2bb1d89d73e9597140d48fc095737f23.png"
avatar="https://s3.eu-west-3.amazonaws.com/tdrive.eu-west-3/public/uploads/wslogo/2bb1d89d73e9597140d48fc095737f23.png"
/>
}
title="Software"
+1 -1
View File
@@ -1,4 +1,4 @@
// --- Twake default colors --- //
// --- Tdrive default colors --- //
@black: #000000;
@black-alpha-50: #18295288;
@black-alpha-70: #18295255;
+1 -1
View File
@@ -1,4 +1,4 @@
// --- Twake fonts --- //
// --- Tdrive fonts --- //
// 'Inter' = Default
// Helvetica Neue = Other alphabets fallback
+1 -1
View File
@@ -1,4 +1,4 @@
// --- Twake shadows --- //
// --- Tdrive shadows --- //
@checkbox-shadow: 0px 0px 20px rgba(0, 0, 0, 0.15);
@box-shadow-base: 0 2px 15px rgba(0, 0, 0, 0.3); //0 2px 4px rgba(0, 0, 0, 0.5)
@box-shadow-large: 0 2px 15px rgba(0, 0, 0, 0.2); //0 2px 4px rgba(0, 0, 0, 0.5)
+1 -1
View File
@@ -1,4 +1,4 @@
// --- Twake sizes --- //
// --- Tdrive sizes --- //
@border-radius-small: 4px;
@border-radius-base: 8px;
@border-radius-large: 20px;
@@ -1,9 +1,9 @@
/*! ==UserStyle==
* @name Twake Dark Mode
* @name Tdrive Dark Mode
* @namespace github.com/chamerling/userstyles
* @version 0.0.6
* @homepageURL https://github.com/chamerling/userstyles/
* @updateURL https://github.com/chamerling/userstyles/raw/main/themes/web.twake.app/dark.user.css
* @updateURL https://github.com/chamerling/userstyles/raw/main/themes/web.tdrive.app/dark.user.css
* @license MIT
* @author chamerling
* ==/UserStyle== */
@@ -34,7 +34,7 @@
--nord14: #a3be8c;
--nord15: #b48ead;
/* Twake variables */
/* Tdrive variables */
--primary: @primary;
--primary-hover: var(--nord10);
--secondary: var(--nord0);

Some files were not shown because too many files have changed in this diff Show More