🛠️ Company user search feature (#300)

🛠️ Company user search feature
This commit is contained in:
Montassar Ghanmy
2023-12-20 08:38:59 +01:00
committed by GitHub
parent 8efe4ec194
commit 75dffb1c7a
7 changed files with 281 additions and 273 deletions
@@ -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 = {