@@ -125,6 +125,7 @@
|
||||
},
|
||||
"drive": {
|
||||
"rootAdmins": "DRIVE_ROOT_ADMINS",
|
||||
"defaultLanguage": "DRIVE_DEFAULT_LANGUAGE"
|
||||
"defaultLanguage": "DRIVE_DEFAULT_LANGUAGE",
|
||||
"featureSearchUsers": "ENABLE_FEATURE_SEARCH_USERS"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
"client_secret": "",
|
||||
"issuer": "",
|
||||
"audience": "",
|
||||
"redirect_uris":[
|
||||
""
|
||||
],
|
||||
"redirect_uris": [""],
|
||||
"account_management_url": "http://web.tdrive-console.local/profile?company-code={company_id}",
|
||||
"collaborators_management_url": "http://web.tdrive-console.local/compaies/{company_id}/users?company-code={company_id}",
|
||||
"company_management_url": "http://web.tdrive-console.local/companies?company-code={company_id}"
|
||||
@@ -59,9 +57,7 @@
|
||||
"websocket": {
|
||||
"path": "/socket/",
|
||||
"adapters": {
|
||||
"types":[
|
||||
|
||||
],
|
||||
"types": [],
|
||||
"redis": {
|
||||
"host": "redis",
|
||||
"port": 6379
|
||||
@@ -88,9 +84,7 @@
|
||||
"database": "tdrive"
|
||||
},
|
||||
"cassandra": {
|
||||
"contactPoints":[
|
||||
"scylladb:9042"
|
||||
],
|
||||
"contactPoints": ["scylladb:9042"],
|
||||
"localDataCenter": "datacenter1",
|
||||
"keyspace": "tdrive",
|
||||
"wait": false,
|
||||
@@ -102,9 +96,7 @@
|
||||
"// possible 'type' values are": "'amqp' or 'local'",
|
||||
"type": "amqp",
|
||||
"amqp": {
|
||||
"urls":[
|
||||
"amqp://guest:guest@rabbitmq:5672"
|
||||
]
|
||||
"urls": ["amqp://guest:guest@rabbitmq:5672"]
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
@@ -141,6 +133,9 @@
|
||||
"sender": "noreply@twake.app",
|
||||
"debug": true
|
||||
},
|
||||
"drive": {
|
||||
"featureSearchUsers": true
|
||||
},
|
||||
"applications": {
|
||||
"grid": [
|
||||
{
|
||||
@@ -224,13 +219,9 @@
|
||||
"external_prefix": "/plugins/onlyoffice/",
|
||||
"id": "tdrive_onlyoffice",
|
||||
"identity": {
|
||||
"categories":[
|
||||
|
||||
],
|
||||
"categories": [],
|
||||
"code": "only_office",
|
||||
"compatibility":[
|
||||
"tdrive"
|
||||
],
|
||||
"compatibility": ["tdrive"],
|
||||
"description": null,
|
||||
"icon": "/plugins/onlyoffice/assets/logo.png",
|
||||
"name": "Only Office",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Company from "./entities/company";
|
||||
import config from "../../core/config";
|
||||
import {
|
||||
CompanyFeaturesEnum,
|
||||
CompanyLimitsEnum,
|
||||
@@ -53,6 +54,9 @@ export function formatCompany(
|
||||
[CompanyFeaturesEnum.CHAT_EDIT_FILES]: true,
|
||||
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]: true,
|
||||
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]: true,
|
||||
// use the config value for this one
|
||||
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]:
|
||||
(config.get("drive.featureSearchUsers") as boolean) || true,
|
||||
},
|
||||
{
|
||||
...(res.plan?.features || {}),
|
||||
@@ -62,6 +66,8 @@ export function formatCompany(
|
||||
},
|
||||
);
|
||||
|
||||
console.log("🚀🚀 res.plan.features: ", res.plan.features);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ export const companyObjectSchema = {
|
||||
[CompanyFeaturesEnum.CHAT_MULTIPLE_WORKSPACES]: { type: "boolean" },
|
||||
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]: { type: "boolean" },
|
||||
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]: { type: "boolean" },
|
||||
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]: { type: "boolean" },
|
||||
guests: { type: "number" }, // to rename or delete
|
||||
members: { type: "number" }, // to rename or delete
|
||||
storage: { type: "number" }, // to rename or delete
|
||||
|
||||
@@ -83,6 +83,7 @@ export enum CompanyFeaturesEnum {
|
||||
CHAT_EDIT_FILES = "chat:edit_files",
|
||||
CHAT_UNLIMITED_STORAGE = "chat:unlimited_storage",
|
||||
COMPANY_INVITE_MEMBER = "company:invite_member",
|
||||
COMPANY_SEARCH_USERS = "company:search_users",
|
||||
}
|
||||
|
||||
export type CompanyFeaturesObject = {
|
||||
@@ -92,6 +93,7 @@ export type CompanyFeaturesObject = {
|
||||
[CompanyFeaturesEnum.CHAT_EDIT_FILES]?: boolean;
|
||||
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]?: boolean;
|
||||
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]?: boolean;
|
||||
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]?: boolean;
|
||||
};
|
||||
|
||||
export type CompanyLimitsObject = {
|
||||
|
||||
@@ -8,6 +8,7 @@ export enum FeatureNames {
|
||||
EDIT_FILES = 'chat:edit_files',
|
||||
UNLIMITED_STORAGE = 'chat:unlimited_storage', //Currently inactive
|
||||
COMPANY_INVITE_MEMBER = 'company:invite_member',
|
||||
COMPANY_SEARCH_USERS = 'company:search_users',
|
||||
}
|
||||
|
||||
export type FeatureValueType = boolean | number;
|
||||
@@ -22,6 +23,7 @@ availableFeaturesWithDefaults.set(FeatureNames.MULTIPLE_WORKSPACES, true);
|
||||
availableFeaturesWithDefaults.set(FeatureNames.EDIT_FILES, true);
|
||||
availableFeaturesWithDefaults.set(FeatureNames.UNLIMITED_STORAGE, true);
|
||||
availableFeaturesWithDefaults.set(FeatureNames.COMPANY_INVITE_MEMBER, true);
|
||||
availableFeaturesWithDefaults.set(FeatureNames.COMPANY_SEARCH_USERS, true);
|
||||
|
||||
/**
|
||||
* ChannelServiceImpl that allow you to manage feature flipping in Tdrive using react feature toggles
|
||||
|
||||
@@ -4,8 +4,11 @@ import { useEffect } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import { InternalAccessManager } from './internal-access';
|
||||
import { PublicLinkManager } from './public-link-access';
|
||||
import { useCurrentCompany } from '@features/companies/hooks/use-companies';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
import FeatureTogglesService, {
|
||||
FeatureNames,
|
||||
} from '@features/global/services/feature-toggles-service';
|
||||
|
||||
export type AccessModalType = {
|
||||
open: boolean;
|
||||
@@ -32,17 +35,19 @@ export const AccessModal = () => {
|
||||
|
||||
const AccessModalContent = ({ id }: { id: string }) => {
|
||||
const { item, access, refresh } = useDriveItem(id);
|
||||
|
||||
const { company, refresh: refreshCompany } = useCurrentCompany();
|
||||
useEffect(() => {
|
||||
refresh(id);
|
||||
refreshCompany();
|
||||
}, []);
|
||||
|
||||
console.log(item?.access_info?.public?.level, 'item');
|
||||
|
||||
return (
|
||||
<ModalContent title={Languages.t('components.item_context_menu.manage_access_to') + " " + item?.name}>
|
||||
<ModalContent
|
||||
title={Languages.t('components.item_context_menu.manage_access_to') + ' ' + item?.name}
|
||||
>
|
||||
<PublicLinkManager id={id} disabled={access !== 'manage'} />
|
||||
{FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_SEARCH_USERS) && (
|
||||
<InternalAccessManager id={id} disabled={access !== 'manage'} />
|
||||
)}
|
||||
</ModalContent>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user