Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 409b2b78f1 |
@@ -10,11 +10,13 @@ type Props = {
|
||||
handleClose: () => void;
|
||||
};
|
||||
|
||||
enum ESendEmailSteps {
|
||||
SEND_EMAIL = "SEND_EMAIL",
|
||||
SUCCESS = "SUCCESS",
|
||||
FAILED = "FAILED",
|
||||
}
|
||||
const ESendEmailSteps = {
|
||||
SEND_EMAIL: "SEND_EMAIL",
|
||||
SUCCESS: "SUCCESS",
|
||||
FAILED: "FAILED",
|
||||
} as const;
|
||||
|
||||
type ESendEmailSteps = typeof ESendEmailSteps[keyof typeof ESendEmailSteps];
|
||||
|
||||
const instanceService = new InstanceService();
|
||||
|
||||
|
||||
@@ -16,14 +16,16 @@ import { Banner, PasswordStrengthMeter } from "@/components/common";
|
||||
const authService = new AuthService();
|
||||
|
||||
// error codes
|
||||
enum EErrorCodes {
|
||||
INSTANCE_NOT_CONFIGURED = "INSTANCE_NOT_CONFIGURED",
|
||||
ADMIN_ALREADY_EXIST = "ADMIN_ALREADY_EXIST",
|
||||
REQUIRED_EMAIL_PASSWORD_FIRST_NAME = "REQUIRED_EMAIL_PASSWORD_FIRST_NAME",
|
||||
INVALID_EMAIL = "INVALID_EMAIL",
|
||||
INVALID_PASSWORD = "INVALID_PASSWORD",
|
||||
USER_ALREADY_EXISTS = "USER_ALREADY_EXISTS",
|
||||
}
|
||||
const EErrorCodes = {
|
||||
INSTANCE_NOT_CONFIGURED: "INSTANCE_NOT_CONFIGURED",
|
||||
ADMIN_ALREADY_EXIST: "ADMIN_ALREADY_EXIST",
|
||||
REQUIRED_EMAIL_PASSWORD_FIRST_NAME: "REQUIRED_EMAIL_PASSWORD_FIRST_NAME",
|
||||
INVALID_EMAIL: "INVALID_EMAIL",
|
||||
INVALID_PASSWORD: "INVALID_PASSWORD",
|
||||
USER_ALREADY_EXISTS: "USER_ALREADY_EXISTS",
|
||||
} as const;
|
||||
|
||||
type EErrorCodes = typeof EErrorCodes[keyof typeof EErrorCodes];
|
||||
|
||||
type TError = {
|
||||
type: EErrorCodes | undefined;
|
||||
@@ -144,7 +146,7 @@ export const InstanceSetupForm: FC = (props) => {
|
||||
|
||||
{errorData.type &&
|
||||
errorData?.message &&
|
||||
![EErrorCodes.INVALID_EMAIL, EErrorCodes.INVALID_PASSWORD].includes(errorData.type) && (
|
||||
!([EErrorCodes.INVALID_EMAIL, EErrorCodes.INVALID_PASSWORD] as EErrorCodes[]).includes(errorData.type) && (
|
||||
<Banner type="error" message={errorData?.message} />
|
||||
)}
|
||||
|
||||
|
||||
@@ -18,13 +18,15 @@ import { AuthBanner } from "../authentication";
|
||||
const authService = new AuthService();
|
||||
|
||||
// error codes
|
||||
enum EErrorCodes {
|
||||
INSTANCE_NOT_CONFIGURED = "INSTANCE_NOT_CONFIGURED",
|
||||
REQUIRED_EMAIL_PASSWORD = "REQUIRED_EMAIL_PASSWORD",
|
||||
INVALID_EMAIL = "INVALID_EMAIL",
|
||||
USER_DOES_NOT_EXIST = "USER_DOES_NOT_EXIST",
|
||||
AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED",
|
||||
}
|
||||
const EErrorCodes = {
|
||||
INSTANCE_NOT_CONFIGURED: "INSTANCE_NOT_CONFIGURED",
|
||||
REQUIRED_EMAIL_PASSWORD: "REQUIRED_EMAIL_PASSWORD",
|
||||
INVALID_EMAIL: "INVALID_EMAIL",
|
||||
USER_DOES_NOT_EXIST: "USER_DOES_NOT_EXIST",
|
||||
AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED",
|
||||
} as const;
|
||||
|
||||
type EErrorCodes = typeof EErrorCodes[keyof typeof EErrorCodes];
|
||||
|
||||
type TError = {
|
||||
type: EErrorCodes | undefined;
|
||||
|
||||
@@ -20,13 +20,15 @@ import githubDarkModeImage from "@/public/logos/github-white.png";
|
||||
import GitlabLogo from "@/public/logos/gitlab-logo.svg";
|
||||
import GoogleLogo from "@/public/logos/google-logo.svg";
|
||||
|
||||
export enum EErrorAlertType {
|
||||
BANNER_ALERT = "BANNER_ALERT",
|
||||
INLINE_FIRST_NAME = "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL = "INLINE_EMAIL",
|
||||
INLINE_PASSWORD = "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE = "INLINE_EMAIL_CODE",
|
||||
}
|
||||
export const EErrorAlertType = {
|
||||
BANNER_ALERT: "BANNER_ALERT",
|
||||
INLINE_FIRST_NAME: "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL: "INLINE_EMAIL",
|
||||
INLINE_PASSWORD: "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE: "INLINE_EMAIL_CODE",
|
||||
} as const;
|
||||
|
||||
export type EErrorAlertType = typeof EErrorAlertType[keyof typeof EErrorAlertType];
|
||||
|
||||
const errorCodeMessages: {
|
||||
[key in EAdminAuthErrorCodes]: { title: string; message: (email?: string | undefined) => ReactNode };
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
export enum AI_EDITOR_TASKS {
|
||||
ASK_ANYTHING = "ASK_ANYTHING",
|
||||
}
|
||||
export const AI_EDITOR_TASKS = {
|
||||
ASK_ANYTHING: "ASK_ANYTHING",
|
||||
} as const;
|
||||
|
||||
export type AI_EDITOR_TASKS = typeof AI_EDITOR_TASKS[keyof typeof AI_EDITOR_TASKS];
|
||||
|
||||
+116
-100
@@ -1,9 +1,11 @@
|
||||
export enum E_PASSWORD_STRENGTH {
|
||||
EMPTY = "empty",
|
||||
LENGTH_NOT_VALID = "length_not_valid",
|
||||
STRENGTH_NOT_VALID = "strength_not_valid",
|
||||
STRENGTH_VALID = "strength_valid",
|
||||
}
|
||||
export const E_PASSWORD_STRENGTH = {
|
||||
EMPTY: "empty",
|
||||
LENGTH_NOT_VALID: "length_not_valid",
|
||||
STRENGTH_NOT_VALID: "strength_not_valid",
|
||||
STRENGTH_VALID: "strength_valid",
|
||||
} as const;
|
||||
|
||||
export type E_PASSWORD_STRENGTH = typeof E_PASSWORD_STRENGTH[keyof typeof E_PASSWORD_STRENGTH];
|
||||
|
||||
export const PASSWORD_MIN_LENGTH = 8;
|
||||
|
||||
@@ -31,41 +33,51 @@ export const SPACE_PASSWORD_CRITERIA = [
|
||||
// },
|
||||
];
|
||||
|
||||
export enum EAuthPageTypes {
|
||||
PUBLIC = "PUBLIC",
|
||||
NON_AUTHENTICATED = "NON_AUTHENTICATED",
|
||||
SET_PASSWORD = "SET_PASSWORD",
|
||||
ONBOARDING = "ONBOARDING",
|
||||
AUTHENTICATED = "AUTHENTICATED",
|
||||
}
|
||||
export const EAuthPageTypes = {
|
||||
PUBLIC: "PUBLIC",
|
||||
NON_AUTHENTICATED: "NON_AUTHENTICATED",
|
||||
SET_PASSWORD: "SET_PASSWORD",
|
||||
ONBOARDING: "ONBOARDING",
|
||||
AUTHENTICATED: "AUTHENTICATED",
|
||||
} as const;
|
||||
|
||||
export enum EPageTypes {
|
||||
INIT = "INIT",
|
||||
PUBLIC = "PUBLIC",
|
||||
NON_AUTHENTICATED = "NON_AUTHENTICATED",
|
||||
ONBOARDING = "ONBOARDING",
|
||||
AUTHENTICATED = "AUTHENTICATED",
|
||||
}
|
||||
export type EAuthPageTypes = typeof EAuthPageTypes[keyof typeof EAuthPageTypes];
|
||||
|
||||
export enum EAuthModes {
|
||||
SIGN_IN = "SIGN_IN",
|
||||
SIGN_UP = "SIGN_UP",
|
||||
}
|
||||
export const EPageTypes = {
|
||||
INIT: "INIT",
|
||||
PUBLIC: "PUBLIC",
|
||||
NON_AUTHENTICATED: "NON_AUTHENTICATED",
|
||||
ONBOARDING: "ONBOARDING",
|
||||
AUTHENTICATED: "AUTHENTICATED",
|
||||
} as const;
|
||||
|
||||
export enum EAuthSteps {
|
||||
EMAIL = "EMAIL",
|
||||
PASSWORD = "PASSWORD",
|
||||
UNIQUE_CODE = "UNIQUE_CODE",
|
||||
}
|
||||
export type EPageTypes = typeof EPageTypes[keyof typeof EPageTypes];
|
||||
|
||||
export enum EErrorAlertType {
|
||||
BANNER_ALERT = "BANNER_ALERT",
|
||||
TOAST_ALERT = "TOAST_ALERT",
|
||||
INLINE_FIRST_NAME = "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL = "INLINE_EMAIL",
|
||||
INLINE_PASSWORD = "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE = "INLINE_EMAIL_CODE",
|
||||
}
|
||||
export const EAuthModes = {
|
||||
SIGN_IN: "SIGN_IN",
|
||||
SIGN_UP: "SIGN_UP",
|
||||
} as const;
|
||||
|
||||
export type EAuthModes = typeof EAuthModes[keyof typeof EAuthModes];
|
||||
|
||||
export const EAuthSteps = {
|
||||
EMAIL: "EMAIL",
|
||||
PASSWORD: "PASSWORD",
|
||||
UNIQUE_CODE: "UNIQUE_CODE",
|
||||
} as const;
|
||||
|
||||
export type EAuthSteps = typeof EAuthSteps[keyof typeof EAuthSteps];
|
||||
|
||||
export const EErrorAlertType = {
|
||||
BANNER_ALERT: "BANNER_ALERT",
|
||||
TOAST_ALERT: "TOAST_ALERT",
|
||||
INLINE_FIRST_NAME: "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL: "INLINE_EMAIL",
|
||||
INLINE_PASSWORD: "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE: "INLINE_EMAIL_CODE",
|
||||
} as const;
|
||||
|
||||
export type EErrorAlertType = typeof EErrorAlertType[keyof typeof EErrorAlertType];
|
||||
|
||||
export type TAuthErrorInfo = {
|
||||
type: EErrorAlertType;
|
||||
@@ -74,79 +86,83 @@ export type TAuthErrorInfo = {
|
||||
message: any;
|
||||
};
|
||||
|
||||
export enum EAdminAuthErrorCodes {
|
||||
export const EAdminAuthErrorCodes = {
|
||||
// Admin
|
||||
ADMIN_ALREADY_EXIST = "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME = "5155",
|
||||
INVALID_ADMIN_EMAIL = "5160",
|
||||
INVALID_ADMIN_PASSWORD = "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD = "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED = "5175",
|
||||
ADMIN_USER_ALREADY_EXIST = "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST = "5185",
|
||||
ADMIN_USER_DEACTIVATED = "5190",
|
||||
}
|
||||
ADMIN_ALREADY_EXIST: "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME: "5155",
|
||||
INVALID_ADMIN_EMAIL: "5160",
|
||||
INVALID_ADMIN_PASSWORD: "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD: "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED: "5175",
|
||||
ADMIN_USER_ALREADY_EXIST: "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST: "5185",
|
||||
ADMIN_USER_DEACTIVATED: "5190",
|
||||
} as const;
|
||||
|
||||
export enum EAuthErrorCodes {
|
||||
export type EAdminAuthErrorCodes = typeof EAdminAuthErrorCodes[keyof typeof EAdminAuthErrorCodes];
|
||||
|
||||
export const EAuthErrorCodes = {
|
||||
// Global
|
||||
INSTANCE_NOT_CONFIGURED = "5000",
|
||||
INVALID_EMAIL = "5005",
|
||||
EMAIL_REQUIRED = "5010",
|
||||
SIGNUP_DISABLED = "5015",
|
||||
MAGIC_LINK_LOGIN_DISABLED = "5016",
|
||||
PASSWORD_LOGIN_DISABLED = "5018",
|
||||
USER_ACCOUNT_DEACTIVATED = "5019",
|
||||
INSTANCE_NOT_CONFIGURED: "5000",
|
||||
INVALID_EMAIL: "5005",
|
||||
EMAIL_REQUIRED: "5010",
|
||||
SIGNUP_DISABLED: "5015",
|
||||
MAGIC_LINK_LOGIN_DISABLED: "5016",
|
||||
PASSWORD_LOGIN_DISABLED: "5018",
|
||||
USER_ACCOUNT_DEACTIVATED: "5019",
|
||||
// Password strength
|
||||
INVALID_PASSWORD = "5020",
|
||||
SMTP_NOT_CONFIGURED = "5025",
|
||||
INVALID_PASSWORD: "5020",
|
||||
SMTP_NOT_CONFIGURED: "5025",
|
||||
// Sign Up
|
||||
USER_ALREADY_EXIST = "5030",
|
||||
AUTHENTICATION_FAILED_SIGN_UP = "5035",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_UP = "5040",
|
||||
INVALID_EMAIL_SIGN_UP = "5045",
|
||||
INVALID_EMAIL_MAGIC_SIGN_UP = "5050",
|
||||
MAGIC_SIGN_UP_EMAIL_CODE_REQUIRED = "5055",
|
||||
USER_ALREADY_EXIST: "5030",
|
||||
AUTHENTICATION_FAILED_SIGN_UP: "5035",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_UP: "5040",
|
||||
INVALID_EMAIL_SIGN_UP: "5045",
|
||||
INVALID_EMAIL_MAGIC_SIGN_UP: "5050",
|
||||
MAGIC_SIGN_UP_EMAIL_CODE_REQUIRED: "5055",
|
||||
// Sign In
|
||||
USER_DOES_NOT_EXIST = "5060",
|
||||
AUTHENTICATION_FAILED_SIGN_IN = "5065",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_IN = "5070",
|
||||
INVALID_EMAIL_SIGN_IN = "5075",
|
||||
INVALID_EMAIL_MAGIC_SIGN_IN = "5080",
|
||||
MAGIC_SIGN_IN_EMAIL_CODE_REQUIRED = "5085",
|
||||
USER_DOES_NOT_EXIST: "5060",
|
||||
AUTHENTICATION_FAILED_SIGN_IN: "5065",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_IN: "5070",
|
||||
INVALID_EMAIL_SIGN_IN: "5075",
|
||||
INVALID_EMAIL_MAGIC_SIGN_IN: "5080",
|
||||
MAGIC_SIGN_IN_EMAIL_CODE_REQUIRED: "5085",
|
||||
// Both Sign in and Sign up for magic
|
||||
INVALID_MAGIC_CODE_SIGN_IN = "5090",
|
||||
INVALID_MAGIC_CODE_SIGN_UP = "5092",
|
||||
EXPIRED_MAGIC_CODE_SIGN_IN = "5095",
|
||||
EXPIRED_MAGIC_CODE_SIGN_UP = "5097",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN = "5100",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP = "5102",
|
||||
INVALID_MAGIC_CODE_SIGN_IN: "5090",
|
||||
INVALID_MAGIC_CODE_SIGN_UP: "5092",
|
||||
EXPIRED_MAGIC_CODE_SIGN_IN: "5095",
|
||||
EXPIRED_MAGIC_CODE_SIGN_UP: "5097",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN: "5100",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP: "5102",
|
||||
// Oauth
|
||||
OAUTH_NOT_CONFIGURED = "5104",
|
||||
GOOGLE_NOT_CONFIGURED = "5105",
|
||||
GITHUB_NOT_CONFIGURED = "5110",
|
||||
GITLAB_NOT_CONFIGURED = "5111",
|
||||
GOOGLE_OAUTH_PROVIDER_ERROR = "5115",
|
||||
GITHUB_OAUTH_PROVIDER_ERROR = "5120",
|
||||
GITLAB_OAUTH_PROVIDER_ERROR = "5121",
|
||||
OAUTH_NOT_CONFIGURED: "5104",
|
||||
GOOGLE_NOT_CONFIGURED: "5105",
|
||||
GITHUB_NOT_CONFIGURED: "5110",
|
||||
GITLAB_NOT_CONFIGURED: "5111",
|
||||
GOOGLE_OAUTH_PROVIDER_ERROR: "5115",
|
||||
GITHUB_OAUTH_PROVIDER_ERROR: "5120",
|
||||
GITLAB_OAUTH_PROVIDER_ERROR: "5121",
|
||||
// Reset Password
|
||||
INVALID_PASSWORD_TOKEN = "5125",
|
||||
EXPIRED_PASSWORD_TOKEN = "5130",
|
||||
INVALID_PASSWORD_TOKEN: "5125",
|
||||
EXPIRED_PASSWORD_TOKEN: "5130",
|
||||
// Change password
|
||||
INCORRECT_OLD_PASSWORD = "5135",
|
||||
MISSING_PASSWORD = "5138",
|
||||
INVALID_NEW_PASSWORD = "5140",
|
||||
INCORRECT_OLD_PASSWORD: "5135",
|
||||
MISSING_PASSWORD: "5138",
|
||||
INVALID_NEW_PASSWORD: "5140",
|
||||
// set password
|
||||
PASSWORD_ALREADY_SET = "5145",
|
||||
PASSWORD_ALREADY_SET: "5145",
|
||||
// Admin
|
||||
ADMIN_ALREADY_EXIST = "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME = "5155",
|
||||
INVALID_ADMIN_EMAIL = "5160",
|
||||
INVALID_ADMIN_PASSWORD = "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD = "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED = "5175",
|
||||
ADMIN_USER_ALREADY_EXIST = "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST = "5185",
|
||||
ADMIN_USER_DEACTIVATED = "5190",
|
||||
ADMIN_ALREADY_EXIST: "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME: "5155",
|
||||
INVALID_ADMIN_EMAIL: "5160",
|
||||
INVALID_ADMIN_PASSWORD: "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD: "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED: "5175",
|
||||
ADMIN_USER_ALREADY_EXIST: "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST: "5185",
|
||||
ADMIN_USER_DEACTIVATED: "5190",
|
||||
// Rate limit
|
||||
RATE_LIMIT_EXCEEDED = "5900",
|
||||
}
|
||||
RATE_LIMIT_EXCEEDED: "5900",
|
||||
} as const;
|
||||
|
||||
export type EAuthErrorCodes = typeof EAuthErrorCodes[keyof typeof EAuthErrorCodes];
|
||||
|
||||
@@ -4,43 +4,49 @@ export const LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracki
|
||||
export const AXIS_LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracking-wide";
|
||||
|
||||
|
||||
export enum ChartXAxisProperty {
|
||||
STATES = "STATES",
|
||||
STATE_GROUPS = "STATE_GROUPS",
|
||||
LABELS = "LABELS",
|
||||
ASSIGNEES = "ASSIGNEES",
|
||||
ESTIMATE_POINTS = "ESTIMATE_POINTS",
|
||||
CYCLES = "CYCLES",
|
||||
MODULES = "MODULES",
|
||||
PRIORITY = "PRIORITY",
|
||||
START_DATE = "START_DATE",
|
||||
TARGET_DATE = "TARGET_DATE",
|
||||
CREATED_AT = "CREATED_AT",
|
||||
COMPLETED_AT = "COMPLETED_AT",
|
||||
CREATED_BY = "CREATED_BY",
|
||||
WORK_ITEM_TYPES = "WORK_ITEM_TYPES",
|
||||
PROJECTS = "PROJECTS",
|
||||
EPICS = "EPICS",
|
||||
}
|
||||
export const ChartXAxisProperty = {
|
||||
STATES: "STATES",
|
||||
STATE_GROUPS: "STATE_GROUPS",
|
||||
LABELS: "LABELS",
|
||||
ASSIGNEES: "ASSIGNEES",
|
||||
ESTIMATE_POINTS: "ESTIMATE_POINTS",
|
||||
CYCLES: "CYCLES",
|
||||
MODULES: "MODULES",
|
||||
PRIORITY: "PRIORITY",
|
||||
START_DATE: "START_DATE",
|
||||
TARGET_DATE: "TARGET_DATE",
|
||||
CREATED_AT: "CREATED_AT",
|
||||
COMPLETED_AT: "COMPLETED_AT",
|
||||
CREATED_BY: "CREATED_BY",
|
||||
WORK_ITEM_TYPES: "WORK_ITEM_TYPES",
|
||||
PROJECTS: "PROJECTS",
|
||||
EPICS: "EPICS",
|
||||
} as const;
|
||||
|
||||
export enum ChartYAxisMetric {
|
||||
WORK_ITEM_COUNT = "WORK_ITEM_COUNT",
|
||||
ESTIMATE_POINT_COUNT = "ESTIMATE_POINT_COUNT",
|
||||
PENDING_WORK_ITEM_COUNT = "PENDING_WORK_ITEM_COUNT",
|
||||
COMPLETED_WORK_ITEM_COUNT = "COMPLETED_WORK_ITEM_COUNT",
|
||||
IN_PROGRESS_WORK_ITEM_COUNT = "IN_PROGRESS_WORK_ITEM_COUNT",
|
||||
WORK_ITEM_DUE_THIS_WEEK_COUNT = "WORK_ITEM_DUE_THIS_WEEK_COUNT",
|
||||
WORK_ITEM_DUE_TODAY_COUNT = "WORK_ITEM_DUE_TODAY_COUNT",
|
||||
BLOCKED_WORK_ITEM_COUNT = "BLOCKED_WORK_ITEM_COUNT",
|
||||
}
|
||||
export type ChartXAxisProperty = typeof ChartXAxisProperty[keyof typeof ChartXAxisProperty];
|
||||
|
||||
export const ChartYAxisMetric = {
|
||||
WORK_ITEM_COUNT: "WORK_ITEM_COUNT",
|
||||
ESTIMATE_POINT_COUNT: "ESTIMATE_POINT_COUNT",
|
||||
PENDING_WORK_ITEM_COUNT: "PENDING_WORK_ITEM_COUNT",
|
||||
COMPLETED_WORK_ITEM_COUNT: "COMPLETED_WORK_ITEM_COUNT",
|
||||
IN_PROGRESS_WORK_ITEM_COUNT: "IN_PROGRESS_WORK_ITEM_COUNT",
|
||||
WORK_ITEM_DUE_THIS_WEEK_COUNT: "WORK_ITEM_DUE_THIS_WEEK_COUNT",
|
||||
WORK_ITEM_DUE_TODAY_COUNT: "WORK_ITEM_DUE_TODAY_COUNT",
|
||||
BLOCKED_WORK_ITEM_COUNT: "BLOCKED_WORK_ITEM_COUNT",
|
||||
} as const;
|
||||
|
||||
export type ChartYAxisMetric = typeof ChartYAxisMetric[keyof typeof ChartYAxisMetric];
|
||||
|
||||
|
||||
export enum ChartXAxisDateGrouping {
|
||||
DAY = "DAY",
|
||||
WEEK = "WEEK",
|
||||
MONTH = "MONTH",
|
||||
YEAR = "YEAR",
|
||||
}
|
||||
export const ChartXAxisDateGrouping = {
|
||||
DAY: "DAY",
|
||||
WEEK: "WEEK",
|
||||
MONTH: "MONTH",
|
||||
YEAR: "YEAR",
|
||||
} as const;
|
||||
|
||||
export type ChartXAxisDateGrouping = typeof ChartXAxisDateGrouping[keyof typeof ChartXAxisDateGrouping];
|
||||
|
||||
export const TO_CAPITALIZE_PROPERTIES: ChartXAxisProperty[] = [
|
||||
ChartXAxisProperty.PRIORITY,
|
||||
@@ -55,14 +61,16 @@ export const CHART_X_AXIS_DATE_PROPERTIES: ChartXAxisProperty[] = [
|
||||
];
|
||||
|
||||
|
||||
export enum EChartModels {
|
||||
BASIC = "BASIC",
|
||||
STACKED = "STACKED",
|
||||
GROUPED = "GROUPED",
|
||||
MULTI_LINE = "MULTI_LINE",
|
||||
COMPARISON = "COMPARISON",
|
||||
PROGRESS = "PROGRESS",
|
||||
}
|
||||
export const EChartModels = {
|
||||
BASIC: "BASIC",
|
||||
STACKED: "STACKED",
|
||||
GROUPED: "GROUPED",
|
||||
MULTI_LINE: "MULTI_LINE",
|
||||
COMPARISON: "COMPARISON",
|
||||
PROGRESS: "PROGRESS",
|
||||
} as const;
|
||||
|
||||
export type EChartModels = typeof EChartModels[keyof typeof EChartModels];
|
||||
|
||||
export const CHART_COLOR_PALETTES: {
|
||||
key: TChartColorScheme;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
// types
|
||||
import { TIssuesListTypes } from "@plane/types";
|
||||
|
||||
export enum EDurationFilters {
|
||||
NONE = "none",
|
||||
TODAY = "today",
|
||||
THIS_WEEK = "this_week",
|
||||
THIS_MONTH = "this_month",
|
||||
THIS_YEAR = "this_year",
|
||||
CUSTOM = "custom",
|
||||
}
|
||||
export const EDurationFilters = {
|
||||
NONE: "none",
|
||||
TODAY: "today",
|
||||
THIS_WEEK: "this_week",
|
||||
THIS_MONTH: "this_month",
|
||||
THIS_YEAR: "this_year",
|
||||
CUSTOM: "custom",
|
||||
} as const;
|
||||
|
||||
export type EDurationFilters = typeof EDurationFilters[keyof typeof EDurationFilters];
|
||||
|
||||
// filter duration options
|
||||
export const DURATION_FILTER_OPTIONS: {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export enum E_SORT_ORDER {
|
||||
ASC = "asc",
|
||||
DESC = "desc",
|
||||
}
|
||||
export const E_SORT_ORDER = {
|
||||
ASC: "asc",
|
||||
DESC: "desc",
|
||||
} as const;
|
||||
|
||||
export type E_SORT_ORDER = typeof E_SORT_ORDER[keyof typeof E_SORT_ORDER];
|
||||
export const DATE_AFTER_FILTER_OPTIONS = [
|
||||
{
|
||||
name: "1 week from now",
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export enum EIconSize {
|
||||
XS = "xs",
|
||||
SM = "sm",
|
||||
MD = "md",
|
||||
LG = "lg",
|
||||
XL = "xl",
|
||||
}
|
||||
export const EIconSize = {
|
||||
XS: "xs",
|
||||
SM: "sm",
|
||||
MD: "md",
|
||||
LG: "lg",
|
||||
XL: "xl",
|
||||
} as const;
|
||||
|
||||
export type EIconSize = typeof EIconSize[keyof typeof EIconSize];
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
import { TInboxDuplicateIssueDetails, TIssue } from "@plane/types";
|
||||
|
||||
export enum EInboxIssueCurrentTab {
|
||||
OPEN = "open",
|
||||
CLOSED = "closed",
|
||||
}
|
||||
export const EInboxIssueCurrentTab = {
|
||||
OPEN: "open",
|
||||
CLOSED: "closed",
|
||||
} as const;
|
||||
|
||||
export enum EInboxIssueStatus {
|
||||
PENDING = -2,
|
||||
DECLINED = -1,
|
||||
SNOOZED = 0,
|
||||
ACCEPTED = 1,
|
||||
DUPLICATE = 2,
|
||||
}
|
||||
export type EInboxIssueCurrentTab = typeof EInboxIssueCurrentTab[keyof typeof EInboxIssueCurrentTab];
|
||||
|
||||
export enum EInboxIssueSource {
|
||||
IN_APP = "IN_APP",
|
||||
FORMS = "FORMS",
|
||||
EMAIL = "EMAIL",
|
||||
}
|
||||
export const EInboxIssueStatus = {
|
||||
PENDING: -2,
|
||||
DECLINED: -1,
|
||||
SNOOZED: 0,
|
||||
ACCEPTED: 1,
|
||||
DUPLICATE: 2,
|
||||
} as const;
|
||||
|
||||
export type EInboxIssueStatus = typeof EInboxIssueStatus[keyof typeof EInboxIssueStatus];
|
||||
|
||||
export const EInboxIssueSource = {
|
||||
IN_APP: "IN_APP",
|
||||
FORMS: "FORMS",
|
||||
EMAIL: "EMAIL",
|
||||
} as const;
|
||||
|
||||
export type EInboxIssueSource = typeof EInboxIssueSource[keyof typeof EInboxIssueSource];
|
||||
|
||||
export type TInboxIssueCurrentTab = EInboxIssueCurrentTab;
|
||||
export type TInboxIssueStatus = EInboxIssueStatus;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export enum EInstanceStatus {
|
||||
ERROR = "ERROR",
|
||||
NOT_YET_READY = "NOT_YET_READY",
|
||||
}
|
||||
export const EInstanceStatus = {
|
||||
ERROR: "ERROR",
|
||||
NOT_YET_READY: "NOT_YET_READY",
|
||||
} as const;
|
||||
|
||||
export type EInstanceStatus = typeof EInstanceStatus[keyof typeof EInstanceStatus];
|
||||
|
||||
export type TInstanceStatus = {
|
||||
status: EInstanceStatus | undefined;
|
||||
|
||||
@@ -17,66 +17,78 @@ export type TIssueFilterPriorityObject = {
|
||||
icon: string;
|
||||
};
|
||||
|
||||
export enum EIssueGroupByToServerOptions {
|
||||
"state" = "state_id",
|
||||
"priority" = "priority",
|
||||
"labels" = "labels__id",
|
||||
"state_detail.group" = "state__group",
|
||||
"assignees" = "assignees__id",
|
||||
"cycle" = "cycle_id",
|
||||
"module" = "issue_module__module_id",
|
||||
"target_date" = "target_date",
|
||||
"project" = "project_id",
|
||||
"created_by" = "created_by",
|
||||
"team_project" = "project_id",
|
||||
}
|
||||
export const EIssueGroupByToServerOptions = {
|
||||
"state": "state_id",
|
||||
"priority": "priority",
|
||||
"labels": "labels__id",
|
||||
"state_detail.group": "state__group",
|
||||
"assignees": "assignees__id",
|
||||
"cycle": "cycle_id",
|
||||
"module": "issue_module__module_id",
|
||||
"target_date": "target_date",
|
||||
"project": "project_id",
|
||||
"created_by": "created_by",
|
||||
"team_project": "project_id",
|
||||
} as const;
|
||||
|
||||
export enum EIssueGroupBYServerToProperty {
|
||||
"state_id" = "state_id",
|
||||
"priority" = "priority",
|
||||
"labels__id" = "label_ids",
|
||||
"state__group" = "state__group",
|
||||
"assignees__id" = "assignee_ids",
|
||||
"cycle_id" = "cycle_id",
|
||||
"issue_module__module_id" = "module_ids",
|
||||
"target_date" = "target_date",
|
||||
"project_id" = "project_id",
|
||||
"created_by" = "created_by",
|
||||
}
|
||||
export type EIssueGroupByToServerOptions = typeof EIssueGroupByToServerOptions[keyof typeof EIssueGroupByToServerOptions];
|
||||
|
||||
export enum EIssueServiceType {
|
||||
ISSUES = "issues",
|
||||
EPICS = "epics",
|
||||
WORK_ITEMS = "work-items",
|
||||
}
|
||||
export const EIssueGroupBYServerToProperty = {
|
||||
"state_id": "state_id",
|
||||
"priority": "priority",
|
||||
"labels__id": "label_ids",
|
||||
"state__group": "state__group",
|
||||
"assignees__id": "assignee_ids",
|
||||
"cycle_id": "cycle_id",
|
||||
"issue_module__module_id": "module_ids",
|
||||
"target_date": "target_date",
|
||||
"project_id": "project_id",
|
||||
"created_by": "created_by",
|
||||
} as const;
|
||||
|
||||
export enum EIssuesStoreType {
|
||||
GLOBAL = "GLOBAL",
|
||||
PROFILE = "PROFILE",
|
||||
TEAM = "TEAM",
|
||||
PROJECT = "PROJECT",
|
||||
CYCLE = "CYCLE",
|
||||
MODULE = "MODULE",
|
||||
TEAM_VIEW = "TEAM_VIEW",
|
||||
PROJECT_VIEW = "PROJECT_VIEW",
|
||||
ARCHIVED = "ARCHIVED",
|
||||
DRAFT = "DRAFT",
|
||||
DEFAULT = "DEFAULT",
|
||||
WORKSPACE_DRAFT = "WORKSPACE_DRAFT",
|
||||
EPIC = "EPIC",
|
||||
}
|
||||
export type EIssueGroupBYServerToProperty = typeof EIssueGroupBYServerToProperty[keyof typeof EIssueGroupBYServerToProperty];
|
||||
|
||||
export enum EIssueCommentAccessSpecifier {
|
||||
EXTERNAL = "EXTERNAL",
|
||||
INTERNAL = "INTERNAL",
|
||||
}
|
||||
export const EIssueServiceType = {
|
||||
ISSUES: "issues",
|
||||
EPICS: "epics",
|
||||
WORK_ITEMS: "work-items",
|
||||
} as const;
|
||||
|
||||
export enum EIssueListRow {
|
||||
HEADER = "HEADER",
|
||||
ISSUE = "ISSUE",
|
||||
NO_ISSUES = "NO_ISSUES",
|
||||
QUICK_ADD = "QUICK_ADD",
|
||||
}
|
||||
export type EIssueServiceType = typeof EIssueServiceType[keyof typeof EIssueServiceType];
|
||||
|
||||
export const EIssuesStoreType = {
|
||||
GLOBAL: "GLOBAL",
|
||||
PROFILE: "PROFILE",
|
||||
TEAM: "TEAM",
|
||||
PROJECT: "PROJECT",
|
||||
CYCLE: "CYCLE",
|
||||
MODULE: "MODULE",
|
||||
TEAM_VIEW: "TEAM_VIEW",
|
||||
PROJECT_VIEW: "PROJECT_VIEW",
|
||||
ARCHIVED: "ARCHIVED",
|
||||
DRAFT: "DRAFT",
|
||||
DEFAULT: "DEFAULT",
|
||||
WORKSPACE_DRAFT: "WORKSPACE_DRAFT",
|
||||
EPIC: "EPIC",
|
||||
} as const;
|
||||
|
||||
export type EIssuesStoreType = typeof EIssuesStoreType[keyof typeof EIssuesStoreType];
|
||||
|
||||
export const EIssueCommentAccessSpecifier = {
|
||||
EXTERNAL: "EXTERNAL",
|
||||
INTERNAL: "INTERNAL",
|
||||
} as const;
|
||||
|
||||
export type EIssueCommentAccessSpecifier = typeof EIssueCommentAccessSpecifier[keyof typeof EIssueCommentAccessSpecifier];
|
||||
|
||||
export const EIssueListRow = {
|
||||
HEADER: "HEADER",
|
||||
ISSUE: "ISSUE",
|
||||
NO_ISSUES: "NO_ISSUES",
|
||||
QUICK_ADD: "QUICK_ADD",
|
||||
} as const;
|
||||
|
||||
export type EIssueListRow = typeof EIssueListRow[keyof typeof EIssueListRow];
|
||||
|
||||
export const ISSUE_PRIORITIES: {
|
||||
key: TIssuePriorities;
|
||||
@@ -114,14 +126,14 @@ export const DRAG_ALLOWED_GROUPS: TIssueGroupByOptions[] = [
|
||||
];
|
||||
|
||||
export type TCreateModalStoreTypes =
|
||||
| EIssuesStoreType.TEAM
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.TEAM_VIEW
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.PROFILE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.TEAM
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.TEAM_VIEW
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.PROFILE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
export const ISSUE_GROUP_BY_OPTIONS: {
|
||||
key: TIssueGroupByOptions;
|
||||
|
||||
@@ -10,25 +10,29 @@ import { TIssueLayout } from "./layout";
|
||||
|
||||
export type TIssueFilterKeys = "priority" | "state" | "labels";
|
||||
|
||||
export enum EServerGroupByToFilterOptions {
|
||||
"state_id" = "state",
|
||||
"priority" = "priority",
|
||||
"labels__id" = "labels",
|
||||
"state__group" = "state_group",
|
||||
"assignees__id" = "assignees",
|
||||
"cycle_id" = "cycle",
|
||||
"issue_module__module_id" = "module",
|
||||
"target_date" = "target_date",
|
||||
"project_id" = "project",
|
||||
"created_by" = "created_by",
|
||||
}
|
||||
export const EServerGroupByToFilterOptions = {
|
||||
"state_id": "state",
|
||||
"priority": "priority",
|
||||
"labels__id": "labels",
|
||||
"state__group": "state_group",
|
||||
"assignees__id": "assignees",
|
||||
"cycle_id": "cycle",
|
||||
"issue_module__module_id": "module",
|
||||
"target_date": "target_date",
|
||||
"project_id": "project",
|
||||
"created_by": "created_by",
|
||||
} as const;
|
||||
|
||||
export enum EIssueFilterType {
|
||||
FILTERS = "filters",
|
||||
DISPLAY_FILTERS = "display_filters",
|
||||
DISPLAY_PROPERTIES = "display_properties",
|
||||
KANBAN_FILTERS = "kanban_filters",
|
||||
}
|
||||
export type EServerGroupByToFilterOptions = typeof EServerGroupByToFilterOptions[keyof typeof EServerGroupByToFilterOptions];
|
||||
|
||||
export const EIssueFilterType = {
|
||||
FILTERS: "filters",
|
||||
DISPLAY_FILTERS: "display_filters",
|
||||
DISPLAY_PROPERTIES: "display_properties",
|
||||
KANBAN_FILTERS: "kanban_filters",
|
||||
} as const;
|
||||
|
||||
export type EIssueFilterType = typeof EIssueFilterType[keyof typeof EIssueFilterType];
|
||||
|
||||
export const ISSUE_DISPLAY_FILTERS_BY_LAYOUT: {
|
||||
[key in TIssueLayout]: Record<"filters", TIssueFilterKeys[]>;
|
||||
@@ -334,10 +338,12 @@ export const ISSUE_STORE_TO_FILTERS_MAP: Partial<Record<EIssuesStoreType, TFilte
|
||||
[EIssuesStoreType.PROJECT]: ISSUE_DISPLAY_FILTERS_BY_PAGE.issues,
|
||||
};
|
||||
|
||||
export enum EActivityFilterType {
|
||||
ACTIVITY = "ACTIVITY",
|
||||
COMMENT = "COMMENT",
|
||||
}
|
||||
export const EActivityFilterType = {
|
||||
ACTIVITY: "ACTIVITY",
|
||||
COMMENT: "COMMENT",
|
||||
} as const;
|
||||
|
||||
export type EActivityFilterType = typeof EActivityFilterType[keyof typeof EActivityFilterType];
|
||||
|
||||
export type TActivityFilters = EActivityFilterType;
|
||||
|
||||
|
||||
@@ -5,13 +5,15 @@ export type TIssueLayout =
|
||||
| "spreadsheet"
|
||||
| "gantt";
|
||||
|
||||
export enum EIssueLayoutTypes {
|
||||
LIST = "list",
|
||||
KANBAN = "kanban",
|
||||
CALENDAR = "calendar",
|
||||
GANTT = "gantt_chart",
|
||||
SPREADSHEET = "spreadsheet",
|
||||
}
|
||||
export const EIssueLayoutTypes = {
|
||||
LIST: "list",
|
||||
KANBAN: "kanban",
|
||||
CALENDAR: "calendar",
|
||||
GANTT: "gantt_chart",
|
||||
SPREADSHEET: "spreadsheet",
|
||||
} as const;
|
||||
|
||||
export type EIssueLayoutTypes = typeof EIssueLayoutTypes[keyof typeof EIssueLayoutTypes];
|
||||
|
||||
export type TIssueLayoutMap = Record<
|
||||
EIssueLayoutTypes,
|
||||
|
||||
@@ -1,31 +1,39 @@
|
||||
import { TUnreadNotificationsCount } from "@plane/types";
|
||||
|
||||
export enum ENotificationTab {
|
||||
ALL = "all",
|
||||
MENTIONS = "mentions",
|
||||
}
|
||||
export const ENotificationTab = {
|
||||
ALL: "all",
|
||||
MENTIONS: "mentions",
|
||||
} as const;
|
||||
|
||||
export enum ENotificationFilterType {
|
||||
CREATED = "created",
|
||||
ASSIGNED = "assigned",
|
||||
SUBSCRIBED = "subscribed",
|
||||
}
|
||||
export type ENotificationTab = typeof ENotificationTab[keyof typeof ENotificationTab];
|
||||
|
||||
export enum ENotificationLoader {
|
||||
INIT_LOADER = "init-loader",
|
||||
MUTATION_LOADER = "mutation-loader",
|
||||
PAGINATION_LOADER = "pagination-loader",
|
||||
REFRESH = "refresh",
|
||||
MARK_ALL_AS_READY = "mark-all-as-read",
|
||||
}
|
||||
export const ENotificationFilterType = {
|
||||
CREATED: "created",
|
||||
ASSIGNED: "assigned",
|
||||
SUBSCRIBED: "subscribed",
|
||||
} as const;
|
||||
|
||||
export enum ENotificationQueryParamType {
|
||||
INIT = "init",
|
||||
CURRENT = "current",
|
||||
NEXT = "next",
|
||||
}
|
||||
export type ENotificationFilterType = typeof ENotificationFilterType[keyof typeof ENotificationFilterType];
|
||||
|
||||
export type TNotificationTab = ENotificationTab.ALL | ENotificationTab.MENTIONS;
|
||||
export const ENotificationLoader = {
|
||||
INIT_LOADER: "init-loader",
|
||||
MUTATION_LOADER: "mutation-loader",
|
||||
PAGINATION_LOADER: "pagination-loader",
|
||||
REFRESH: "refresh",
|
||||
MARK_ALL_AS_READY: "mark-all-as-read",
|
||||
} as const;
|
||||
|
||||
export type ENotificationLoader = typeof ENotificationLoader[keyof typeof ENotificationLoader];
|
||||
|
||||
export const ENotificationQueryParamType = {
|
||||
INIT: "init",
|
||||
CURRENT: "current",
|
||||
NEXT: "next",
|
||||
} as const;
|
||||
|
||||
export type ENotificationQueryParamType = typeof ENotificationQueryParamType[keyof typeof ENotificationQueryParamType];
|
||||
|
||||
export type TNotificationTab = typeof ENotificationTab.ALL | typeof ENotificationTab.MENTIONS;
|
||||
|
||||
export const NOTIFICATION_TABS = [
|
||||
{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export enum EPageAccess {
|
||||
PUBLIC = 0,
|
||||
PRIVATE = 1,
|
||||
}
|
||||
export const EPageAccess = {
|
||||
PUBLIC: 0,
|
||||
PRIVATE: 1,
|
||||
} as const;
|
||||
|
||||
export type EPageAccess = typeof EPageAccess[keyof typeof EPageAccess];
|
||||
|
||||
export type TCreatePageModal = {
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -3,13 +3,15 @@ import { IPaymentProduct, TBillingFrequency, TProductBillingFrequency } from "@p
|
||||
/**
|
||||
* Enum representing different product subscription types
|
||||
*/
|
||||
export enum EProductSubscriptionEnum {
|
||||
FREE = "FREE",
|
||||
ONE = "ONE",
|
||||
PRO = "PRO",
|
||||
BUSINESS = "BUSINESS",
|
||||
ENTERPRISE = "ENTERPRISE",
|
||||
}
|
||||
export const EProductSubscriptionEnum = {
|
||||
FREE: "FREE",
|
||||
ONE: "ONE",
|
||||
PRO: "PRO",
|
||||
BUSINESS: "BUSINESS",
|
||||
ENTERPRISE: "ENTERPRISE",
|
||||
} as const;
|
||||
|
||||
export type EProductSubscriptionEnum = typeof EProductSubscriptionEnum[keyof typeof EProductSubscriptionEnum];
|
||||
|
||||
/**
|
||||
* Default billing frequency for each product subscription type
|
||||
@@ -29,7 +31,7 @@ export const SUBSCRIPTION_WITH_BILLING_FREQUENCY = [
|
||||
EProductSubscriptionEnum.PRO,
|
||||
EProductSubscriptionEnum.BUSINESS,
|
||||
EProductSubscriptionEnum.ENTERPRISE,
|
||||
];
|
||||
] as EProductSubscriptionEnum[];
|
||||
|
||||
/**
|
||||
* Mapping of product subscription types to their respective payment product details
|
||||
|
||||
@@ -107,15 +107,17 @@ export const PREFERENCE_OPTIONS: {
|
||||
* @description The start of the week for the user
|
||||
* @enum {number}
|
||||
*/
|
||||
export enum EStartOfTheWeek {
|
||||
SUNDAY = 0,
|
||||
MONDAY = 1,
|
||||
TUESDAY = 2,
|
||||
WEDNESDAY = 3,
|
||||
THURSDAY = 4,
|
||||
FRIDAY = 5,
|
||||
SATURDAY = 6,
|
||||
}
|
||||
export const EStartOfTheWeek = {
|
||||
SUNDAY: 0,
|
||||
MONDAY: 1,
|
||||
TUESDAY: 2,
|
||||
WEDNESDAY: 3,
|
||||
THURSDAY: 4,
|
||||
FRIDAY: 5,
|
||||
SATURDAY: 6,
|
||||
} as const;
|
||||
|
||||
export type EStartOfTheWeek = typeof EStartOfTheWeek[keyof typeof EStartOfTheWeek];
|
||||
|
||||
/**
|
||||
* @description The options for the start of the week
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
import { PROFILE_SETTINGS } from ".";
|
||||
import { WORKSPACE_SETTINGS } from "./workspace";
|
||||
|
||||
export enum WORKSPACE_SETTINGS_CATEGORY {
|
||||
ADMINISTRATION = "administration",
|
||||
FEATURES = "features",
|
||||
DEVELOPER = "developer",
|
||||
}
|
||||
export const WORKSPACE_SETTINGS_CATEGORY = {
|
||||
ADMINISTRATION: "administration",
|
||||
FEATURES: "features",
|
||||
DEVELOPER: "developer",
|
||||
} as const;
|
||||
|
||||
export enum PROFILE_SETTINGS_CATEGORY {
|
||||
YOUR_PROFILE = "your profile",
|
||||
DEVELOPER = "developer",
|
||||
}
|
||||
export type WORKSPACE_SETTINGS_CATEGORY = typeof WORKSPACE_SETTINGS_CATEGORY[keyof typeof WORKSPACE_SETTINGS_CATEGORY];
|
||||
|
||||
export enum PROJECT_SETTINGS_CATEGORY {
|
||||
PROJECTS = "projects",
|
||||
}
|
||||
export const PROFILE_SETTINGS_CATEGORY = {
|
||||
YOUR_PROFILE: "your profile",
|
||||
DEVELOPER: "developer",
|
||||
} as const;
|
||||
|
||||
export type PROFILE_SETTINGS_CATEGORY = typeof PROFILE_SETTINGS_CATEGORY[keyof typeof PROFILE_SETTINGS_CATEGORY];
|
||||
|
||||
export const PROJECT_SETTINGS_CATEGORY = {
|
||||
PROJECTS: "projects",
|
||||
} as const;
|
||||
|
||||
export type PROJECT_SETTINGS_CATEGORY = typeof PROJECT_SETTINGS_CATEGORY[keyof typeof PROJECT_SETTINGS_CATEGORY];
|
||||
|
||||
export const WORKSPACE_SETTINGS_CATEGORIES = [
|
||||
WORKSPACE_SETTINGS_CATEGORY.ADMINISTRATION,
|
||||
|
||||
@@ -89,16 +89,18 @@ export const PROJECT_PAGE_TAB_INDICES = [
|
||||
"submit",
|
||||
];
|
||||
|
||||
export enum ETabIndices {
|
||||
ISSUE_FORM = "issue-form",
|
||||
INTAKE_ISSUE_FORM = "intake-issue-form",
|
||||
CREATE_LABEL = "create-label",
|
||||
PROJECT_CREATE = "project-create",
|
||||
PROJECT_CYCLE = "project-cycle",
|
||||
PROJECT_MODULE = "project-module",
|
||||
PROJECT_VIEW = "project-view",
|
||||
PROJECT_PAGE = "project-page",
|
||||
}
|
||||
export const ETabIndices = {
|
||||
ISSUE_FORM: "issue-form",
|
||||
INTAKE_ISSUE_FORM: "intake-issue-form",
|
||||
CREATE_LABEL: "create-label",
|
||||
PROJECT_CREATE: "project-create",
|
||||
PROJECT_CYCLE: "project-cycle",
|
||||
PROJECT_MODULE: "project-module",
|
||||
PROJECT_VIEW: "project-view",
|
||||
PROJECT_PAGE: "project-page",
|
||||
} as const;
|
||||
|
||||
export type ETabIndices = typeof ETabIndices[keyof typeof ETabIndices];
|
||||
|
||||
export const TAB_INDEX_MAP: Record<ETabIndices, string[]> = {
|
||||
[ETabIndices.ISSUE_FORM]: ISSUE_FORM_TAB_INDICES,
|
||||
|
||||
@@ -1,49 +1,63 @@
|
||||
export enum EAuthenticationPageType {
|
||||
STATIC = "STATIC",
|
||||
NOT_AUTHENTICATED = "NOT_AUTHENTICATED",
|
||||
AUTHENTICATED = "AUTHENTICATED",
|
||||
}
|
||||
export const EAuthenticationPageType = {
|
||||
STATIC: "STATIC",
|
||||
NOT_AUTHENTICATED: "NOT_AUTHENTICATED",
|
||||
AUTHENTICATED: "AUTHENTICATED",
|
||||
} as const;
|
||||
|
||||
export enum EInstancePageType {
|
||||
PRE_SETUP = "PRE_SETUP",
|
||||
POST_SETUP = "POST_SETUP",
|
||||
}
|
||||
export type EAuthenticationPageType = typeof EAuthenticationPageType[keyof typeof EAuthenticationPageType];
|
||||
|
||||
export enum EUserStatus {
|
||||
ERROR = "ERROR",
|
||||
AUTHENTICATION_NOT_DONE = "AUTHENTICATION_NOT_DONE",
|
||||
NOT_YET_READY = "NOT_YET_READY",
|
||||
}
|
||||
export const EInstancePageType = {
|
||||
PRE_SETUP: "PRE_SETUP",
|
||||
POST_SETUP: "POST_SETUP",
|
||||
} as const;
|
||||
|
||||
export type EInstancePageType = typeof EInstancePageType[keyof typeof EInstancePageType];
|
||||
|
||||
export const EUserStatus = {
|
||||
ERROR: "ERROR",
|
||||
AUTHENTICATION_NOT_DONE: "AUTHENTICATION_NOT_DONE",
|
||||
NOT_YET_READY: "NOT_YET_READY",
|
||||
} as const;
|
||||
|
||||
export type EUserStatus = typeof EUserStatus[keyof typeof EUserStatus];
|
||||
|
||||
export type TUserStatus = {
|
||||
status: EUserStatus | undefined;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
export enum EUserPermissionsLevel {
|
||||
WORKSPACE = "WORKSPACE",
|
||||
PROJECT = "PROJECT",
|
||||
}
|
||||
export const EUserPermissionsLevel = {
|
||||
WORKSPACE: "WORKSPACE",
|
||||
PROJECT: "PROJECT",
|
||||
} as const;
|
||||
|
||||
export enum EUserWorkspaceRoles {
|
||||
ADMIN = 20,
|
||||
MEMBER = 15,
|
||||
GUEST = 5,
|
||||
}
|
||||
export type EUserPermissionsLevel = typeof EUserPermissionsLevel[keyof typeof EUserPermissionsLevel];
|
||||
|
||||
export enum EUserProjectRoles {
|
||||
ADMIN = 20,
|
||||
MEMBER = 15,
|
||||
GUEST = 5,
|
||||
}
|
||||
export const EUserWorkspaceRoles = {
|
||||
ADMIN: 20,
|
||||
MEMBER: 15,
|
||||
GUEST: 5,
|
||||
} as const;
|
||||
|
||||
export type EUserWorkspaceRoles = typeof EUserWorkspaceRoles[keyof typeof EUserWorkspaceRoles];
|
||||
|
||||
export const EUserProjectRoles = {
|
||||
ADMIN: 20,
|
||||
MEMBER: 15,
|
||||
GUEST: 5,
|
||||
} as const;
|
||||
|
||||
export type EUserProjectRoles = typeof EUserProjectRoles[keyof typeof EUserProjectRoles];
|
||||
|
||||
export type TUserPermissionsLevel = EUserPermissionsLevel;
|
||||
|
||||
export enum EUserPermissions {
|
||||
ADMIN = 20,
|
||||
MEMBER = 15,
|
||||
GUEST = 5,
|
||||
}
|
||||
export const EUserPermissions = {
|
||||
ADMIN: 20,
|
||||
MEMBER: 15,
|
||||
GUEST: 5,
|
||||
} as const;
|
||||
|
||||
export type EUserPermissions = typeof EUserPermissions[keyof typeof EUserPermissions];
|
||||
export type TUserPermissions = EUserPermissions;
|
||||
|
||||
export type TUserAllowedPermissionsObject = {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export enum EViewAccess {
|
||||
PRIVATE,
|
||||
PUBLIC,
|
||||
}
|
||||
export const EViewAccess = {
|
||||
PRIVATE: 0,
|
||||
PUBLIC: 1,
|
||||
} as const;
|
||||
|
||||
export type EViewAccess = typeof EViewAccess[keyof typeof EViewAccess];
|
||||
|
||||
export const VIEW_ACCESS_SPECIFIERS: {
|
||||
key: EViewAccess;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
export enum EDraftIssuePaginationType {
|
||||
INIT = "INIT",
|
||||
NEXT = "NEXT",
|
||||
PREV = "PREV",
|
||||
CURRENT = "CURRENT",
|
||||
}
|
||||
export const EDraftIssuePaginationType = {
|
||||
INIT: "INIT",
|
||||
NEXT: "NEXT",
|
||||
PREV: "PREV",
|
||||
CURRENT: "CURRENT",
|
||||
} as const;
|
||||
|
||||
export type EDraftIssuePaginationType = typeof EDraftIssuePaginationType[keyof typeof EDraftIssuePaginationType];
|
||||
|
||||
@@ -118,7 +118,7 @@ export const WORKSPACE_SETTINGS = {
|
||||
|
||||
export const WORKSPACE_SETTINGS_ACCESS = Object.fromEntries(
|
||||
Object.entries(WORKSPACE_SETTINGS).map(([_, { href, access }]) => [href, access])
|
||||
);
|
||||
) as Record<string, EUserWorkspaceRoles[]>;
|
||||
|
||||
export const WORKSPACE_SETTINGS_LINKS: {
|
||||
key: string;
|
||||
|
||||
@@ -1,44 +1,46 @@
|
||||
export enum CORE_EXTENSIONS {
|
||||
BLOCKQUOTE = "blockquote",
|
||||
BOLD = "bold",
|
||||
BULLET_LIST = "bulletList",
|
||||
CALLOUT = "calloutComponent",
|
||||
CHARACTER_COUNT = "characterCount",
|
||||
CODE_BLOCK = "codeBlock",
|
||||
CODE_INLINE = "code",
|
||||
CUSTOM_COLOR = "customColor",
|
||||
CUSTOM_IMAGE = "imageComponent",
|
||||
CUSTOM_LINK = "link",
|
||||
DOCUMENT = "doc",
|
||||
DROP_CURSOR = "dropCursor",
|
||||
ENTER_KEY = "enterKey",
|
||||
GAP_CURSOR = "gapCursor",
|
||||
HARD_BREAK = "hardBreak",
|
||||
HEADING = "heading",
|
||||
HEADINGS_LIST = "headingsList",
|
||||
HISTORY = "history",
|
||||
HORIZONTAL_RULE = "horizontalRule",
|
||||
IMAGE = "image",
|
||||
ITALIC = "italic",
|
||||
LIST_ITEM = "listItem",
|
||||
MARKDOWN_CLIPBOARD = "markdownClipboard",
|
||||
MENTION = "mention",
|
||||
ORDERED_LIST = "orderedList",
|
||||
PARAGRAPH = "paragraph",
|
||||
PLACEHOLDER = "placeholder",
|
||||
SIDE_MENU = "editorSideMenu",
|
||||
SLASH_COMMANDS = "slash-command",
|
||||
STRIKETHROUGH = "strike",
|
||||
TABLE = "table",
|
||||
TABLE_CELL = "tableCell",
|
||||
TABLE_HEADER = "tableHeader",
|
||||
TABLE_ROW = "tableRow",
|
||||
TASK_ITEM = "taskItem",
|
||||
TASK_LIST = "taskList",
|
||||
TEXT_ALIGN = "textAlign",
|
||||
TEXT_STYLE = "textStyle",
|
||||
TYPOGRAPHY = "typography",
|
||||
UNDERLINE = "underline",
|
||||
UTILITY = "utility",
|
||||
WORK_ITEM_EMBED = "issue-embed-component",
|
||||
}
|
||||
export const CORE_EXTENSIONS = {
|
||||
BLOCKQUOTE: "blockquote",
|
||||
BOLD: "bold",
|
||||
BULLET_LIST: "bulletList",
|
||||
CALLOUT: "calloutComponent",
|
||||
CHARACTER_COUNT: "characterCount",
|
||||
CODE_BLOCK: "codeBlock",
|
||||
CODE_INLINE: "code",
|
||||
CUSTOM_COLOR: "customColor",
|
||||
CUSTOM_IMAGE: "imageComponent",
|
||||
CUSTOM_LINK: "link",
|
||||
DOCUMENT: "doc",
|
||||
DROP_CURSOR: "dropCursor",
|
||||
ENTER_KEY: "enterKey",
|
||||
GAP_CURSOR: "gapCursor",
|
||||
HARD_BREAK: "hardBreak",
|
||||
HEADING: "heading",
|
||||
HEADINGS_LIST: "headingsList",
|
||||
HISTORY: "history",
|
||||
HORIZONTAL_RULE: "horizontalRule",
|
||||
IMAGE: "image",
|
||||
ITALIC: "italic",
|
||||
LIST_ITEM: "listItem",
|
||||
MARKDOWN_CLIPBOARD: "markdownClipboard",
|
||||
MENTION: "mention",
|
||||
ORDERED_LIST: "orderedList",
|
||||
PARAGRAPH: "paragraph",
|
||||
PLACEHOLDER: "placeholder",
|
||||
SIDE_MENU: "editorSideMenu",
|
||||
SLASH_COMMANDS: "slash-command",
|
||||
STRIKETHROUGH: "strike",
|
||||
TABLE: "table",
|
||||
TABLE_CELL: "tableCell",
|
||||
TABLE_HEADER: "tableHeader",
|
||||
TABLE_ROW: "tableRow",
|
||||
TASK_ITEM: "taskItem",
|
||||
TASK_LIST: "taskList",
|
||||
TEXT_ALIGN: "textAlign",
|
||||
TEXT_STYLE: "textStyle",
|
||||
TYPOGRAPHY: "typography",
|
||||
UNDERLINE: "underline",
|
||||
UTILITY: "utility",
|
||||
WORK_ITEM_EMBED: "issue-embed-component",
|
||||
} as const;
|
||||
|
||||
export type CORE_EXTENSIONS = typeof CORE_EXTENSIONS[keyof typeof CORE_EXTENSIONS];
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
export enum CORE_EDITOR_META {
|
||||
SKIP_FILE_DELETION = "skipFileDeletion",
|
||||
}
|
||||
export const CORE_EDITOR_META = {
|
||||
SKIP_FILE_DELETION: "skipFileDeletion",
|
||||
} as const;
|
||||
|
||||
export type CORE_EDITOR_META = typeof CORE_EDITOR_META[keyof typeof CORE_EDITOR_META];
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
export enum EAttributeNames {
|
||||
ICON_COLOR = "data-icon-color",
|
||||
ICON_NAME = "data-icon-name",
|
||||
EMOJI_UNICODE = "data-emoji-unicode",
|
||||
EMOJI_URL = "data-emoji-url",
|
||||
LOGO_IN_USE = "data-logo-in-use",
|
||||
BACKGROUND = "data-background",
|
||||
BLOCK_TYPE = "data-block-type",
|
||||
}
|
||||
export const EAttributeNames = {
|
||||
ICON_COLOR: "data-icon-color",
|
||||
ICON_NAME: "data-icon-name",
|
||||
EMOJI_UNICODE: "data-emoji-unicode",
|
||||
EMOJI_URL: "data-emoji-url",
|
||||
LOGO_IN_USE: "data-logo-in-use",
|
||||
BACKGROUND: "data-background",
|
||||
BLOCK_TYPE: "data-block-type",
|
||||
} as const;
|
||||
|
||||
export type EAttributeNames = typeof EAttributeNames[keyof typeof EAttributeNames];
|
||||
|
||||
export type TCalloutBlockIconAttributes = {
|
||||
[EAttributeNames.ICON_COLOR]: string | undefined;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// plane types
|
||||
import { TSearchEntities } from "@plane/types";
|
||||
|
||||
export enum EMentionComponentAttributeNames {
|
||||
ID = "id",
|
||||
ENTITY_IDENTIFIER = "entity_identifier",
|
||||
ENTITY_NAME = "entity_name",
|
||||
}
|
||||
export const EMentionComponentAttributeNames = {
|
||||
ID: "id",
|
||||
ENTITY_IDENTIFIER: "entity_identifier",
|
||||
ENTITY_NAME: "entity_name",
|
||||
} as const;
|
||||
|
||||
export type EMentionComponentAttributeNames = typeof EMentionComponentAttributeNames[keyof typeof EMentionComponentAttributeNames];
|
||||
|
||||
export type TMentionComponentAttributes = {
|
||||
[EMentionComponentAttributeNames.ID]: string | null;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
export enum EFileError {
|
||||
INVALID_FILE_TYPE = "INVALID_FILE_TYPE",
|
||||
FILE_SIZE_TOO_LARGE = "FILE_SIZE_TOO_LARGE",
|
||||
NO_FILE_SELECTED = "NO_FILE_SELECTED",
|
||||
}
|
||||
export const EFileError = {
|
||||
INVALID_FILE_TYPE: "INVALID_FILE_TYPE",
|
||||
FILE_SIZE_TOO_LARGE: "FILE_SIZE_TOO_LARGE",
|
||||
NO_FILE_SELECTED: "NO_FILE_SELECTED",
|
||||
} as const;
|
||||
|
||||
export type EFileError = typeof EFileError[keyof typeof EFileError];
|
||||
|
||||
type TArgs = {
|
||||
acceptedMimeTypes: string[];
|
||||
|
||||
@@ -28,10 +28,12 @@ export const SUPPORTED_LANGUAGES: ILanguageOption[] = [
|
||||
* Enum for translation file names
|
||||
* These are the JSON files that contain translations each category
|
||||
*/
|
||||
export enum ETranslationFiles {
|
||||
TRANSLATIONS = "translations",
|
||||
ACCESSIBILITY = "accessibility",
|
||||
EDITOR = "editor",
|
||||
}
|
||||
export const ETranslationFiles = {
|
||||
TRANSLATIONS: "translations",
|
||||
ACCESSIBILITY: "accessibility",
|
||||
EDITOR: "editor",
|
||||
} as const;
|
||||
|
||||
export type ETranslationFiles = typeof ETranslationFiles[keyof typeof ETranslationFiles];
|
||||
|
||||
export const LANGUAGE_STORAGE_KEY = "userLanguage";
|
||||
|
||||
+81
-61
@@ -1,75 +1,95 @@
|
||||
export enum EUserPermissions {
|
||||
ADMIN = 20,
|
||||
MEMBER = 15,
|
||||
GUEST = 5,
|
||||
}
|
||||
export const EUserPermissions = {
|
||||
ADMIN: 20,
|
||||
MEMBER: 15,
|
||||
GUEST: 5,
|
||||
} as const;
|
||||
|
||||
export type TUserPermissions = EUserPermissions.ADMIN | EUserPermissions.MEMBER | EUserPermissions.GUEST;
|
||||
export type EUserPermissions = typeof EUserPermissions[keyof typeof EUserPermissions];
|
||||
|
||||
export type TUserPermissions = EUserPermissions;
|
||||
|
||||
// project network
|
||||
export enum EProjectNetwork {
|
||||
PRIVATE = 0,
|
||||
PUBLIC = 2,
|
||||
}
|
||||
export const EProjectNetwork = {
|
||||
PRIVATE: 0,
|
||||
PUBLIC: 2,
|
||||
} as const;
|
||||
|
||||
export type EProjectNetwork = typeof EProjectNetwork[keyof typeof EProjectNetwork];
|
||||
|
||||
// project pages
|
||||
export enum EPageAccess {
|
||||
PUBLIC = 0,
|
||||
PRIVATE = 1,
|
||||
}
|
||||
export const EPageAccess = {
|
||||
PUBLIC: 0,
|
||||
PRIVATE: 1,
|
||||
} as const;
|
||||
|
||||
export enum EDurationFilters {
|
||||
NONE = "none",
|
||||
TODAY = "today",
|
||||
THIS_WEEK = "this_week",
|
||||
THIS_MONTH = "this_month",
|
||||
THIS_YEAR = "this_year",
|
||||
CUSTOM = "custom",
|
||||
}
|
||||
export type EPageAccess = typeof EPageAccess[keyof typeof EPageAccess];
|
||||
|
||||
export enum EIssueCommentAccessSpecifier {
|
||||
EXTERNAL = "EXTERNAL",
|
||||
INTERNAL = "INTERNAL",
|
||||
}
|
||||
export const EDurationFilters = {
|
||||
NONE: "none",
|
||||
TODAY: "today",
|
||||
THIS_WEEK: "this_week",
|
||||
THIS_MONTH: "this_month",
|
||||
THIS_YEAR: "this_year",
|
||||
CUSTOM: "custom",
|
||||
} as const;
|
||||
|
||||
export type EDurationFilters = typeof EDurationFilters[keyof typeof EDurationFilters];
|
||||
|
||||
export const EIssueCommentAccessSpecifier = {
|
||||
EXTERNAL: "EXTERNAL",
|
||||
INTERNAL: "INTERNAL",
|
||||
} as const;
|
||||
|
||||
export type EIssueCommentAccessSpecifier = typeof EIssueCommentAccessSpecifier[keyof typeof EIssueCommentAccessSpecifier];
|
||||
|
||||
// estimates
|
||||
export enum EEstimateSystem {
|
||||
POINTS = "points",
|
||||
CATEGORIES = "categories",
|
||||
TIME = "time",
|
||||
}
|
||||
export const EEstimateSystem = {
|
||||
POINTS: "points",
|
||||
CATEGORIES: "categories",
|
||||
TIME: "time",
|
||||
} as const;
|
||||
|
||||
export enum EEstimateUpdateStages {
|
||||
CREATE = "create",
|
||||
EDIT = "edit",
|
||||
SWITCH = "switch",
|
||||
}
|
||||
export type EEstimateSystem = typeof EEstimateSystem[keyof typeof EEstimateSystem];
|
||||
|
||||
export const EEstimateUpdateStages = {
|
||||
CREATE: "create",
|
||||
EDIT: "edit",
|
||||
SWITCH: "switch",
|
||||
} as const;
|
||||
|
||||
export type EEstimateUpdateStages = typeof EEstimateUpdateStages[keyof typeof EEstimateUpdateStages];
|
||||
|
||||
// workspace notifications
|
||||
export enum ENotificationFilterType {
|
||||
CREATED = "created",
|
||||
ASSIGNED = "assigned",
|
||||
SUBSCRIBED = "subscribed",
|
||||
}
|
||||
export const ENotificationFilterType = {
|
||||
CREATED: "created",
|
||||
ASSIGNED: "assigned",
|
||||
SUBSCRIBED: "subscribed",
|
||||
} as const;
|
||||
|
||||
export enum EFileAssetType {
|
||||
COMMENT_DESCRIPTION = "COMMENT_DESCRIPTION",
|
||||
ISSUE_ATTACHMENT = "ISSUE_ATTACHMENT",
|
||||
ISSUE_DESCRIPTION = "ISSUE_DESCRIPTION",
|
||||
DRAFT_ISSUE_DESCRIPTION = "DRAFT_ISSUE_DESCRIPTION",
|
||||
PAGE_DESCRIPTION = "PAGE_DESCRIPTION",
|
||||
PROJECT_COVER = "PROJECT_COVER",
|
||||
USER_AVATAR = "USER_AVATAR",
|
||||
USER_COVER = "USER_COVER",
|
||||
WORKSPACE_LOGO = "WORKSPACE_LOGO",
|
||||
TEAM_SPACE_DESCRIPTION = "TEAM_SPACE_DESCRIPTION",
|
||||
INITIATIVE_DESCRIPTION = "INITIATIVE_DESCRIPTION",
|
||||
PROJECT_DESCRIPTION = "PROJECT_DESCRIPTION",
|
||||
TEAM_SPACE_COMMENT_DESCRIPTION = "TEAM_SPACE_COMMENT_DESCRIPTION",
|
||||
}
|
||||
export type ENotificationFilterType = typeof ENotificationFilterType[keyof typeof ENotificationFilterType];
|
||||
|
||||
export enum EUpdateStatus {
|
||||
OFF_TRACK = "OFF-TRACK",
|
||||
ON_TRACK = "ON-TRACK",
|
||||
AT_RISK = "AT-RISK",
|
||||
}
|
||||
export const EFileAssetType = {
|
||||
COMMENT_DESCRIPTION: "COMMENT_DESCRIPTION",
|
||||
ISSUE_ATTACHMENT: "ISSUE_ATTACHMENT",
|
||||
ISSUE_DESCRIPTION: "ISSUE_DESCRIPTION",
|
||||
DRAFT_ISSUE_DESCRIPTION: "DRAFT_ISSUE_DESCRIPTION",
|
||||
PAGE_DESCRIPTION: "PAGE_DESCRIPTION",
|
||||
PROJECT_COVER: "PROJECT_COVER",
|
||||
USER_AVATAR: "USER_AVATAR",
|
||||
USER_COVER: "USER_COVER",
|
||||
WORKSPACE_LOGO: "WORKSPACE_LOGO",
|
||||
TEAM_SPACE_DESCRIPTION: "TEAM_SPACE_DESCRIPTION",
|
||||
INITIATIVE_DESCRIPTION: "INITIATIVE_DESCRIPTION",
|
||||
PROJECT_DESCRIPTION: "PROJECT_DESCRIPTION",
|
||||
TEAM_SPACE_COMMENT_DESCRIPTION: "TEAM_SPACE_COMMENT_DESCRIPTION",
|
||||
} as const;
|
||||
|
||||
export type EFileAssetType = typeof EFileAssetType[keyof typeof EFileAssetType];
|
||||
|
||||
export const EUpdateStatus = {
|
||||
OFF_TRACK: "OFF-TRACK",
|
||||
ON_TRACK: "ON-TRACK",
|
||||
AT_RISK: "AT-RISK",
|
||||
} as const;
|
||||
|
||||
export type EUpdateStatus = typeof EUpdateStatus[keyof typeof EUpdateStatus];
|
||||
Vendored
+2
-2
@@ -16,7 +16,7 @@ export interface IWorkspace {
|
||||
readonly updated_by: string;
|
||||
organization_size: string;
|
||||
total_projects?: number;
|
||||
role: number;
|
||||
role: EUserWorkspaceRoles;
|
||||
}
|
||||
|
||||
export interface IWorkspaceLite {
|
||||
@@ -83,7 +83,7 @@ export interface IWorkspaceMemberMe {
|
||||
default_props: IWorkspaceViewProps;
|
||||
id: string;
|
||||
member: string;
|
||||
role: TUserPermissions | EUserWorkspaceRoles;
|
||||
role: EUserWorkspaceRoles;
|
||||
updated_at: Date;
|
||||
updated_by: string;
|
||||
view_props: IWorkspaceViewProps;
|
||||
|
||||
@@ -25,22 +25,19 @@ export interface IBadgeStyling {
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: convert them to objects instead of enums
|
||||
enum badgeSizeStyling {
|
||||
sm = `px-2.5 py-1 font-medium text-xs rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
md = `px-4 py-1.5 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
lg = `px-4 py-2 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
xl = `px-5 py-3 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
}
|
||||
const badgeSizeStyling = {
|
||||
sm: `px-2.5 py-1 font-medium text-xs rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
md: `px-4 py-1.5 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
lg: `px-4 py-2 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
xl: `px-5 py-3 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center inline`,
|
||||
} as const;
|
||||
|
||||
// TODO: convert them to objects instead of enums
|
||||
enum badgeIconStyling {
|
||||
sm = "h-3 w-3 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
md = "h-3.5 w-3.5 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
lg = "h-4 w-4 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
||||
xl = "h-4 w-4 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
}
|
||||
const badgeIconStyling = {
|
||||
sm: "h-3 w-3 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
md: "h-3.5 w-3.5 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
lg: "h-4 w-4 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
xl: "h-4 w-4 flex justify-center items-center overflow-hidden flex-shrink-0",
|
||||
} as const;
|
||||
|
||||
export const badgeStyling: IBadgeStyling = {
|
||||
primary: {
|
||||
|
||||
@@ -22,19 +22,19 @@ export interface IButtonStyling {
|
||||
};
|
||||
}
|
||||
|
||||
enum buttonSizeStyling {
|
||||
sm = `px-3 py-1.5 font-medium text-xs rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
md = `px-4 py-1.5 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
lg = `px-5 py-2 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
xl = `px-5 py-3.5 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
}
|
||||
const buttonSizeStyling = {
|
||||
sm: `px-3 py-1.5 font-medium text-xs rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
md: `px-4 py-1.5 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
lg: `px-5 py-2 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
xl: `px-5 py-3.5 font-medium text-sm rounded flex items-center gap-1.5 whitespace-nowrap transition-all justify-center`,
|
||||
} as const;
|
||||
|
||||
enum buttonIconStyling {
|
||||
sm = "h-3 w-3 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0",
|
||||
md = "h-3.5 w-3.5 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0",
|
||||
lg = "h-4 w-4 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0",
|
||||
xl = "h-4 w-4 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0 ",
|
||||
}
|
||||
const buttonIconStyling = {
|
||||
sm: "h-3 w-3 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0",
|
||||
md: "h-3.5 w-3.5 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0",
|
||||
lg: "h-4 w-4 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0",
|
||||
xl: "h-4 w-4 flex justify-center items-center overflow-hidden my-0.5 flex-shrink-0 ",
|
||||
} as const;
|
||||
|
||||
export const buttonStyling: IButtonStyling = {
|
||||
primary: {
|
||||
|
||||
@@ -1,34 +1,39 @@
|
||||
export enum ECardVariant {
|
||||
WITHOUT_SHADOW = "without-shadow",
|
||||
WITH_SHADOW = "with-shadow",
|
||||
}
|
||||
export enum ECardDirection {
|
||||
ROW = "row",
|
||||
COLUMN = "column",
|
||||
}
|
||||
export enum ECardSpacing {
|
||||
SM = "sm",
|
||||
LG = "lg",
|
||||
}
|
||||
export type TCardVariant = ECardVariant.WITHOUT_SHADOW | ECardVariant.WITH_SHADOW;
|
||||
export type TCardDirection = ECardDirection.ROW | ECardDirection.COLUMN;
|
||||
export type TCardSpacing = ECardSpacing.SM | ECardSpacing.LG;
|
||||
export const ECardVariant = {
|
||||
WITHOUT_SHADOW: "without-shadow",
|
||||
WITH_SHADOW: "with-shadow",
|
||||
} as const;
|
||||
|
||||
export interface ICardProperties {
|
||||
[key: string]: string;
|
||||
}
|
||||
export type ECardVariant = typeof ECardVariant[keyof typeof ECardVariant];
|
||||
|
||||
export const ECardDirection = {
|
||||
ROW: "row",
|
||||
COLUMN: "column",
|
||||
} as const;
|
||||
|
||||
export type ECardDirection = typeof ECardDirection[keyof typeof ECardDirection];
|
||||
|
||||
export const ECardSpacing = {
|
||||
SM: "sm",
|
||||
LG: "lg",
|
||||
} as const;
|
||||
|
||||
export type ECardSpacing = typeof ECardSpacing[keyof typeof ECardSpacing];
|
||||
|
||||
export type TCardVariant = typeof ECardVariant.WITHOUT_SHADOW | typeof ECardVariant.WITH_SHADOW;
|
||||
export type TCardDirection = typeof ECardDirection.ROW | typeof ECardDirection.COLUMN;
|
||||
export type TCardSpacing = typeof ECardSpacing.SM | typeof ECardSpacing.LG;
|
||||
|
||||
const DEFAULT_STYLE =
|
||||
"bg-custom-background-100 rounded-lg border-[0.5px] border-custom-border-200 w-full flex flex-col";
|
||||
export const containerStyle: ICardProperties = {
|
||||
export const containerStyle: Record<ECardVariant, string> = {
|
||||
[ECardVariant.WITHOUT_SHADOW]: "",
|
||||
[ECardVariant.WITH_SHADOW]: "hover:shadow-custom-shadow-4xl duration-300",
|
||||
};
|
||||
export const spacings = {
|
||||
export const spacings: Record<ECardSpacing, string> = {
|
||||
[ECardSpacing.SM]: "p-4",
|
||||
[ECardSpacing.LG]: "p-6",
|
||||
};
|
||||
export const directions = {
|
||||
export const directions: Record<ECardDirection, string> = {
|
||||
[ECardDirection.ROW]: "flex-row space-x-3",
|
||||
[ECardDirection.COLUMN]: "flex-col space-y-3",
|
||||
};
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Placement } from "@popperjs/core";
|
||||
import { EmojiClickData, Theme } from "emoji-picker-react";
|
||||
|
||||
export enum EmojiIconPickerTypes {
|
||||
EMOJI = "emoji",
|
||||
ICON = "icon",
|
||||
}
|
||||
export const EmojiIconPickerTypes = {
|
||||
EMOJI: "emoji",
|
||||
ICON: "icon",
|
||||
} as const;
|
||||
|
||||
export type EmojiIconPickerTypes = typeof EmojiIconPickerTypes[keyof typeof EmojiIconPickerTypes];
|
||||
|
||||
export const TABS_LIST = [
|
||||
{
|
||||
@@ -19,11 +21,11 @@ export const TABS_LIST = [
|
||||
|
||||
export type TChangeHandlerProps =
|
||||
| {
|
||||
type: EmojiIconPickerTypes.EMOJI;
|
||||
type: typeof EmojiIconPickerTypes.EMOJI;
|
||||
value: EmojiClickData;
|
||||
}
|
||||
| {
|
||||
type: EmojiIconPickerTypes.ICON;
|
||||
type: typeof EmojiIconPickerTypes.ICON;
|
||||
value: {
|
||||
name: string;
|
||||
color: string;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
export enum EHeaderVariant {
|
||||
PRIMARY = "primary",
|
||||
SECONDARY = "secondary",
|
||||
TERNARY = "ternary",
|
||||
}
|
||||
export type THeaderVariant = EHeaderVariant.PRIMARY | EHeaderVariant.SECONDARY | EHeaderVariant.TERNARY;
|
||||
export const EHeaderVariant = {
|
||||
PRIMARY: "primary",
|
||||
SECONDARY: "secondary",
|
||||
TERNARY: "ternary",
|
||||
} as const;
|
||||
|
||||
export type EHeaderVariant = typeof EHeaderVariant[keyof typeof EHeaderVariant];
|
||||
|
||||
export type THeaderVariant = typeof EHeaderVariant.PRIMARY | typeof EHeaderVariant.SECONDARY | typeof EHeaderVariant.TERNARY;
|
||||
|
||||
export interface IHeaderProperties {
|
||||
[key: string]: string;
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
export enum EModalPosition {
|
||||
TOP = "flex items-center justify-center text-center mx-4 my-10 md:my-20",
|
||||
CENTER = "flex items-end sm:items-center justify-center p-4 min-h-full",
|
||||
}
|
||||
export const EModalPosition = {
|
||||
TOP: "flex items-center justify-center text-center mx-4 my-10 md:my-20",
|
||||
CENTER: "flex items-end sm:items-center justify-center p-4 min-h-full",
|
||||
} as const;
|
||||
|
||||
export enum EModalWidth {
|
||||
SM = "sm:max-w-sm",
|
||||
MD = "sm:max-w-md",
|
||||
LG = "sm:max-w-lg",
|
||||
XL = "sm:max-w-xl",
|
||||
XXL = "sm:max-w-2xl",
|
||||
XXXL = "sm:max-w-3xl",
|
||||
XXXXL = "sm:max-w-4xl",
|
||||
VXL = "sm:max-w-5xl",
|
||||
VIXL = "sm:max-w-6xl",
|
||||
VIIXL = "sm:max-w-7xl",
|
||||
}
|
||||
export type EModalPosition = typeof EModalPosition[keyof typeof EModalPosition];
|
||||
|
||||
export const EModalWidth = {
|
||||
SM: "sm:max-w-sm",
|
||||
MD: "sm:max-w-md",
|
||||
LG: "sm:max-w-lg",
|
||||
XL: "sm:max-w-xl",
|
||||
XXL: "sm:max-w-2xl",
|
||||
XXXL: "sm:max-w-3xl",
|
||||
XXXXL: "sm:max-w-4xl",
|
||||
VXL: "sm:max-w-5xl",
|
||||
VIXL: "sm:max-w-6xl",
|
||||
VIIXL: "sm:max-w-7xl",
|
||||
} as const;
|
||||
|
||||
export type EModalWidth = typeof EModalWidth[keyof typeof EModalWidth];
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
export enum ERowVariant {
|
||||
REGULAR = "regular",
|
||||
HUGGING = "hugging",
|
||||
}
|
||||
export type TRowVariant = ERowVariant.REGULAR | ERowVariant.HUGGING;
|
||||
export const ERowVariant = {
|
||||
REGULAR: "regular",
|
||||
HUGGING: "hugging",
|
||||
} as const;
|
||||
|
||||
export type ERowVariant = typeof ERowVariant[keyof typeof ERowVariant];
|
||||
|
||||
export type TRowVariant = typeof ERowVariant.REGULAR | typeof ERowVariant.HUGGING;
|
||||
export interface IRowProperties {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
export enum ETagVariant {
|
||||
OUTLINED = "outlined",
|
||||
}
|
||||
export enum ETagSize {
|
||||
SM = "sm",
|
||||
LG = "lg",
|
||||
}
|
||||
export type TTagVariant = ETagVariant.OUTLINED;
|
||||
export const ETagVariant = {
|
||||
OUTLINED: "outlined",
|
||||
} as const;
|
||||
|
||||
export type TTagSize = ETagSize.SM | ETagSize.LG;
|
||||
export type ETagVariant = typeof ETagVariant[keyof typeof ETagVariant];
|
||||
|
||||
export const ETagSize = {
|
||||
SM: "sm",
|
||||
LG: "lg",
|
||||
} as const;
|
||||
|
||||
export type ETagSize = typeof ETagSize[keyof typeof ETagSize];
|
||||
|
||||
export type TTagVariant = typeof ETagVariant.OUTLINED;
|
||||
|
||||
export type TTagSize = typeof ETagSize.SM | typeof ETagSize.LG;
|
||||
export interface ITagProperties {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
@@ -7,22 +7,24 @@ import { CircularBarSpinner } from "../spinners";
|
||||
// helper
|
||||
import { cn } from "../../helpers";
|
||||
|
||||
export enum TOAST_TYPE {
|
||||
SUCCESS = "success",
|
||||
ERROR = "error",
|
||||
INFO = "info",
|
||||
WARNING = "warning",
|
||||
LOADING = "loading",
|
||||
}
|
||||
export const TOAST_TYPE = {
|
||||
SUCCESS: "success",
|
||||
ERROR: "error",
|
||||
INFO: "info",
|
||||
WARNING: "warning",
|
||||
LOADING: "loading",
|
||||
} as const;
|
||||
|
||||
export type TOAST_TYPE = (typeof TOAST_TYPE)[keyof typeof TOAST_TYPE];
|
||||
|
||||
type SetToastProps =
|
||||
| {
|
||||
type: TOAST_TYPE.LOADING;
|
||||
type: typeof TOAST_TYPE.LOADING;
|
||||
title?: string;
|
||||
}
|
||||
| {
|
||||
id?: string | number;
|
||||
type: Exclude<TOAST_TYPE, TOAST_TYPE.LOADING>;
|
||||
type: Exclude<TOAST_TYPE, typeof TOAST_TYPE.LOADING>;
|
||||
title: string;
|
||||
message?: string;
|
||||
actionItems?: React.ReactNode;
|
||||
|
||||
@@ -11,13 +11,15 @@ import {
|
||||
/**
|
||||
* @description Password strength levels
|
||||
*/
|
||||
export enum PasswordStrength {
|
||||
EMPTY = "empty",
|
||||
WEAK = "weak",
|
||||
FAIR = "fair",
|
||||
GOOD = "good",
|
||||
STRONG = "strong",
|
||||
}
|
||||
export const PasswordStrength = {
|
||||
EMPTY: "empty",
|
||||
WEAK: "weak",
|
||||
FAIR: "fair",
|
||||
GOOD: "good",
|
||||
STRONG: "strong",
|
||||
} as const;
|
||||
|
||||
export type PasswordStrength = typeof PasswordStrength[keyof typeof PasswordStrength];
|
||||
|
||||
/**
|
||||
* @description Password strength criteria type
|
||||
@@ -373,7 +375,11 @@ export const authErrorHandler = (
|
||||
EAuthErrorCodes.ADMIN_USER_ALREADY_EXIST,
|
||||
EAuthErrorCodes.ADMIN_USER_DOES_NOT_EXIST,
|
||||
EAuthErrorCodes.USER_ACCOUNT_DEACTIVATED,
|
||||
];
|
||||
EAuthErrorCodes.MAGIC_LINK_LOGIN_DISABLED,
|
||||
EAuthErrorCodes.PASSWORD_LOGIN_DISABLED,
|
||||
EAuthErrorCodes.ADMIN_USER_DEACTIVATED,
|
||||
EAuthErrorCodes.RATE_LIMIT_EXCEEDED,
|
||||
] as EAuthErrorCodes[];
|
||||
|
||||
if (bannerAlertErrorCodes.includes(errorCode))
|
||||
return {
|
||||
|
||||
@@ -58,21 +58,21 @@ export const AuthRoot: FC = observer(() => {
|
||||
setAuthStep(EAuthSteps.PASSWORD);
|
||||
}
|
||||
if (
|
||||
[
|
||||
([
|
||||
EAuthenticationErrorCodes.INVALID_MAGIC_CODE_SIGN_IN,
|
||||
EAuthenticationErrorCodes.EXPIRED_MAGIC_CODE_SIGN_IN,
|
||||
EAuthenticationErrorCodes.EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN,
|
||||
].includes(errorhandler.code)
|
||||
] as EAuthenticationErrorCodes[]).includes(errorhandler.code)
|
||||
) {
|
||||
setAuthMode(EAuthModes.SIGN_IN);
|
||||
setAuthStep(EAuthSteps.UNIQUE_CODE);
|
||||
}
|
||||
if (
|
||||
[
|
||||
([
|
||||
EAuthenticationErrorCodes.INVALID_MAGIC_CODE_SIGN_UP,
|
||||
EAuthenticationErrorCodes.EXPIRED_MAGIC_CODE_SIGN_UP,
|
||||
EAuthenticationErrorCodes.EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP,
|
||||
].includes(errorhandler.code)
|
||||
] as EAuthenticationErrorCodes[]).includes(errorhandler.code)
|
||||
) {
|
||||
setAuthMode(EAuthModes.SIGN_UP);
|
||||
setAuthStep(EAuthSteps.UNIQUE_CODE);
|
||||
|
||||
@@ -27,11 +27,13 @@ import { CoreRootStore } from "../root.store";
|
||||
|
||||
export type TIssueDisplayFilterOptions = Exclude<TIssueGroupByOptions, null | "team_project"> | "target_date";
|
||||
|
||||
export enum EIssueGroupedAction {
|
||||
ADD = "ADD",
|
||||
DELETE = "DELETE",
|
||||
REORDER = "REORDER",
|
||||
}
|
||||
export const EIssueGroupedAction = {
|
||||
ADD: "ADD",
|
||||
DELETE: "DELETE",
|
||||
REORDER: "REORDER",
|
||||
} as const;
|
||||
|
||||
export type EIssueGroupedAction = typeof EIssueGroupedAction[keyof typeof EIssueGroupedAction];
|
||||
|
||||
export interface IBaseIssuesStore {
|
||||
// observable
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
export enum EAuthModes {
|
||||
SIGN_IN = "SIGN_IN",
|
||||
SIGN_UP = "SIGN_UP",
|
||||
}
|
||||
export const EAuthModes = {
|
||||
SIGN_IN: "SIGN_IN",
|
||||
SIGN_UP: "SIGN_UP",
|
||||
} as const;
|
||||
|
||||
export enum EAuthSteps {
|
||||
EMAIL = "EMAIL",
|
||||
PASSWORD = "PASSWORD",
|
||||
UNIQUE_CODE = "UNIQUE_CODE",
|
||||
}
|
||||
export type EAuthModes = typeof EAuthModes[keyof typeof EAuthModes];
|
||||
|
||||
export const EAuthSteps = {
|
||||
EMAIL: "EMAIL",
|
||||
PASSWORD: "PASSWORD",
|
||||
UNIQUE_CODE: "UNIQUE_CODE",
|
||||
} as const;
|
||||
|
||||
export type EAuthSteps = typeof EAuthSteps[keyof typeof EAuthSteps];
|
||||
|
||||
export interface ICsrfTokenData {
|
||||
csrf_token: string;
|
||||
|
||||
@@ -3,81 +3,87 @@ import Link from "next/link";
|
||||
// helpers
|
||||
import { SUPPORT_EMAIL } from "./common.helper";
|
||||
|
||||
export enum EPageTypes {
|
||||
INIT = "INIT",
|
||||
PUBLIC = "PUBLIC",
|
||||
NON_AUTHENTICATED = "NON_AUTHENTICATED",
|
||||
ONBOARDING = "ONBOARDING",
|
||||
AUTHENTICATED = "AUTHENTICATED",
|
||||
}
|
||||
export const EPageTypes = {
|
||||
INIT: "INIT",
|
||||
PUBLIC: "PUBLIC",
|
||||
NON_AUTHENTICATED: "NON_AUTHENTICATED",
|
||||
ONBOARDING: "ONBOARDING",
|
||||
AUTHENTICATED: "AUTHENTICATED",
|
||||
} as const;
|
||||
|
||||
export enum EErrorAlertType {
|
||||
BANNER_ALERT = "BANNER_ALERT",
|
||||
TOAST_ALERT = "TOAST_ALERT",
|
||||
INLINE_FIRST_NAME = "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL = "INLINE_EMAIL",
|
||||
INLINE_PASSWORD = "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE = "INLINE_EMAIL_CODE",
|
||||
}
|
||||
export type EPageTypes = typeof EPageTypes[keyof typeof EPageTypes];
|
||||
|
||||
export enum EAuthenticationErrorCodes {
|
||||
export const EErrorAlertType = {
|
||||
BANNER_ALERT: "BANNER_ALERT",
|
||||
TOAST_ALERT: "TOAST_ALERT",
|
||||
INLINE_FIRST_NAME: "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL: "INLINE_EMAIL",
|
||||
INLINE_PASSWORD: "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE: "INLINE_EMAIL_CODE",
|
||||
} as const;
|
||||
|
||||
export type EErrorAlertType = typeof EErrorAlertType[keyof typeof EErrorAlertType];
|
||||
|
||||
export const EAuthenticationErrorCodes = {
|
||||
// Global
|
||||
INSTANCE_NOT_CONFIGURED = "5000",
|
||||
INVALID_EMAIL = "5005",
|
||||
EMAIL_REQUIRED = "5010",
|
||||
SIGNUP_DISABLED = "5015",
|
||||
INSTANCE_NOT_CONFIGURED: "5000",
|
||||
INVALID_EMAIL: "5005",
|
||||
EMAIL_REQUIRED: "5010",
|
||||
SIGNUP_DISABLED: "5015",
|
||||
// Password strength
|
||||
INVALID_PASSWORD = "5020",
|
||||
SMTP_NOT_CONFIGURED = "5025",
|
||||
INVALID_PASSWORD: "5020",
|
||||
SMTP_NOT_CONFIGURED: "5025",
|
||||
// Sign Up
|
||||
USER_ALREADY_EXIST = "5030",
|
||||
AUTHENTICATION_FAILED_SIGN_UP = "5035",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_UP = "5040",
|
||||
INVALID_EMAIL_SIGN_UP = "5045",
|
||||
INVALID_EMAIL_MAGIC_SIGN_UP = "5050",
|
||||
MAGIC_SIGN_UP_EMAIL_CODE_REQUIRED = "5055",
|
||||
USER_ALREADY_EXIST: "5030",
|
||||
AUTHENTICATION_FAILED_SIGN_UP: "5035",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_UP: "5040",
|
||||
INVALID_EMAIL_SIGN_UP: "5045",
|
||||
INVALID_EMAIL_MAGIC_SIGN_UP: "5050",
|
||||
MAGIC_SIGN_UP_EMAIL_CODE_REQUIRED: "5055",
|
||||
// Sign In
|
||||
USER_ACCOUNT_DEACTIVATED = "5019",
|
||||
USER_DOES_NOT_EXIST = "5060",
|
||||
AUTHENTICATION_FAILED_SIGN_IN = "5065",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_IN = "5070",
|
||||
INVALID_EMAIL_SIGN_IN = "5075",
|
||||
INVALID_EMAIL_MAGIC_SIGN_IN = "5080",
|
||||
MAGIC_SIGN_IN_EMAIL_CODE_REQUIRED = "5085",
|
||||
USER_ACCOUNT_DEACTIVATED: "5019",
|
||||
USER_DOES_NOT_EXIST: "5060",
|
||||
AUTHENTICATION_FAILED_SIGN_IN: "5065",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_IN: "5070",
|
||||
INVALID_EMAIL_SIGN_IN: "5075",
|
||||
INVALID_EMAIL_MAGIC_SIGN_IN: "5080",
|
||||
MAGIC_SIGN_IN_EMAIL_CODE_REQUIRED: "5085",
|
||||
// Both Sign in and Sign up for magic
|
||||
INVALID_MAGIC_CODE_SIGN_IN = "5090",
|
||||
INVALID_MAGIC_CODE_SIGN_UP = "5092",
|
||||
EXPIRED_MAGIC_CODE_SIGN_IN = "5095",
|
||||
EXPIRED_MAGIC_CODE_SIGN_UP = "5097",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN = "5100",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP = "5102",
|
||||
INVALID_MAGIC_CODE_SIGN_IN: "5090",
|
||||
INVALID_MAGIC_CODE_SIGN_UP: "5092",
|
||||
EXPIRED_MAGIC_CODE_SIGN_IN: "5095",
|
||||
EXPIRED_MAGIC_CODE_SIGN_UP: "5097",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN: "5100",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP: "5102",
|
||||
// Oauth
|
||||
OAUTH_NOT_CONFIGURED = "5104",
|
||||
GOOGLE_NOT_CONFIGURED = "5105",
|
||||
GITHUB_NOT_CONFIGURED = "5110",
|
||||
GITLAB_NOT_CONFIGURED = "5111",
|
||||
GOOGLE_OAUTH_PROVIDER_ERROR = "5115",
|
||||
GITHUB_OAUTH_PROVIDER_ERROR = "5120",
|
||||
GITLAB_OAUTH_PROVIDER_ERROR = "5121",
|
||||
OAUTH_NOT_CONFIGURED: "5104",
|
||||
GOOGLE_NOT_CONFIGURED: "5105",
|
||||
GITHUB_NOT_CONFIGURED: "5110",
|
||||
GITLAB_NOT_CONFIGURED: "5111",
|
||||
GOOGLE_OAUTH_PROVIDER_ERROR: "5115",
|
||||
GITHUB_OAUTH_PROVIDER_ERROR: "5120",
|
||||
GITLAB_OAUTH_PROVIDER_ERROR: "5121",
|
||||
// Reset Password
|
||||
INVALID_PASSWORD_TOKEN = "5125",
|
||||
EXPIRED_PASSWORD_TOKEN = "5130",
|
||||
INVALID_PASSWORD_TOKEN: "5125",
|
||||
EXPIRED_PASSWORD_TOKEN: "5130",
|
||||
// Change password
|
||||
INCORRECT_OLD_PASSWORD = "5135",
|
||||
MISSING_PASSWORD = "5138",
|
||||
INVALID_NEW_PASSWORD = "5140",
|
||||
INCORRECT_OLD_PASSWORD: "5135",
|
||||
MISSING_PASSWORD: "5138",
|
||||
INVALID_NEW_PASSWORD: "5140",
|
||||
// set passowrd
|
||||
PASSWORD_ALREADY_SET = "5145",
|
||||
PASSWORD_ALREADY_SET: "5145",
|
||||
// Admin
|
||||
ADMIN_ALREADY_EXIST = "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME = "5155",
|
||||
INVALID_ADMIN_EMAIL = "5160",
|
||||
INVALID_ADMIN_PASSWORD = "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD = "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED = "5175",
|
||||
ADMIN_USER_ALREADY_EXIST = "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST = "5185",
|
||||
}
|
||||
ADMIN_ALREADY_EXIST: "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME: "5155",
|
||||
INVALID_ADMIN_EMAIL: "5160",
|
||||
INVALID_ADMIN_PASSWORD: "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD: "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED: "5175",
|
||||
ADMIN_USER_ALREADY_EXIST: "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST: "5185",
|
||||
} as const;
|
||||
|
||||
export type EAuthenticationErrorCodes = typeof EAuthenticationErrorCodes[keyof typeof EAuthenticationErrorCodes];
|
||||
|
||||
export type TAuthErrorInfo = {
|
||||
type: EErrorAlertType;
|
||||
@@ -383,7 +389,7 @@ export const authErrorHandler = (
|
||||
EAuthenticationErrorCodes.ADMIN_USER_ALREADY_EXIST,
|
||||
EAuthenticationErrorCodes.ADMIN_USER_DOES_NOT_EXIST,
|
||||
EAuthenticationErrorCodes.USER_ACCOUNT_DEACTIVATED,
|
||||
];
|
||||
] as EAuthenticationErrorCodes[];
|
||||
|
||||
if (bannerAlertErrorCodes.includes(errorCode))
|
||||
return {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import zxcvbn from "zxcvbn";
|
||||
|
||||
export enum E_PASSWORD_STRENGTH {
|
||||
EMPTY = "empty",
|
||||
LENGTH_NOT_VALID = "length_not_valid",
|
||||
STRENGTH_NOT_VALID = "strength_not_valid",
|
||||
STRENGTH_VALID = "strength_valid",
|
||||
}
|
||||
export const E_PASSWORD_STRENGTH = {
|
||||
EMPTY: "empty",
|
||||
LENGTH_NOT_VALID: "length_not_valid",
|
||||
STRENGTH_NOT_VALID: "strength_not_valid",
|
||||
STRENGTH_VALID: "strength_valid",
|
||||
} as const;
|
||||
|
||||
export type E_PASSWORD_STRENGTH = typeof E_PASSWORD_STRENGTH[keyof typeof E_PASSWORD_STRENGTH];
|
||||
|
||||
const PASSWORD_MIN_LENGTH = 8;
|
||||
// const PASSWORD_NUMBER_REGEX = /\d/;
|
||||
|
||||
@@ -30,7 +30,7 @@ const WorkspaceSettingLayout: FC<IWorkspaceSettingLayout> = observer((props) =>
|
||||
|
||||
let isAuthorized: boolean | string = false;
|
||||
if (pathname && workspaceSlug && userWorkspaceRole) {
|
||||
isAuthorized = WORKSPACE_SETTINGS_ACCESS[accessKey]?.includes(userWorkspaceRole as EUserWorkspaceRoles);
|
||||
isAuthorized = WORKSPACE_SETTINGS_ACCESS[accessKey]?.includes(userWorkspaceRole);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -52,7 +52,7 @@ export const WorkspaceSettingsSidebar = (props: TWorkspaceSettingsSidebarProps)
|
||||
isMobile={isMobile}
|
||||
categories={WORKSPACE_SETTINGS_CATEGORIES.filter(
|
||||
(category) =>
|
||||
isAdmin || ![WORKSPACE_SETTINGS_CATEGORY.FEATURES, WORKSPACE_SETTINGS_CATEGORY.DEVELOPER].includes(category)
|
||||
isAdmin || !([WORKSPACE_SETTINGS_CATEGORY.FEATURES, WORKSPACE_SETTINGS_CATEGORY.DEVELOPER] as WORKSPACE_SETTINGS_CATEGORY[]).includes(category)
|
||||
)}
|
||||
groupedSettings={GROUPED_WORKSPACE_SETTINGS}
|
||||
workspaceSlug={workspaceSlug.toString()}
|
||||
|
||||
@@ -22,11 +22,13 @@ import { AuthenticationWrapper } from "@/lib/wrappers";
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
// services
|
||||
|
||||
enum EOnboardingSteps {
|
||||
PROFILE_SETUP = "PROFILE_SETUP",
|
||||
WORKSPACE_CREATE_OR_JOIN = "WORKSPACE_CREATE_OR_JOIN",
|
||||
INVITE_MEMBERS = "INVITE_MEMBERS",
|
||||
}
|
||||
const EOnboardingSteps = {
|
||||
PROFILE_SETUP: "PROFILE_SETUP",
|
||||
WORKSPACE_CREATE_OR_JOIN: "WORKSPACE_CREATE_OR_JOIN",
|
||||
INVITE_MEMBERS: "INVITE_MEMBERS",
|
||||
} as const;
|
||||
|
||||
type EOnboardingSteps = typeof EOnboardingSteps[keyof typeof EOnboardingSteps];
|
||||
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
export enum AI_EDITOR_TASKS {
|
||||
ASK_ANYTHING = "ASK_ANYTHING",
|
||||
}
|
||||
export const AI_EDITOR_TASKS = {
|
||||
ASK_ANYTHING: "ASK_ANYTHING",
|
||||
} as const;
|
||||
|
||||
export type AI_EDITOR_TASKS = typeof AI_EDITOR_TASKS[keyof typeof AI_EDITOR_TASKS];
|
||||
|
||||
export const LOADING_TEXTS: {
|
||||
[key in AI_EDITOR_TASKS]: string;
|
||||
|
||||
@@ -3,17 +3,21 @@ import { TEstimateSystems } from "@plane/types";
|
||||
|
||||
export const MAX_ESTIMATE_POINT_INPUT_LENGTH = 20;
|
||||
|
||||
export enum EEstimateSystem {
|
||||
POINTS = "points",
|
||||
CATEGORIES = "categories",
|
||||
TIME = "time",
|
||||
}
|
||||
export const EEstimateSystem = {
|
||||
POINTS: "points",
|
||||
CATEGORIES: "categories",
|
||||
TIME: "time",
|
||||
} as const;
|
||||
|
||||
export enum EEstimateUpdateStages {
|
||||
CREATE = "create",
|
||||
EDIT = "edit",
|
||||
SWITCH = "switch",
|
||||
}
|
||||
export type EEstimateSystem = typeof EEstimateSystem[keyof typeof EEstimateSystem];
|
||||
|
||||
export const EEstimateUpdateStages = {
|
||||
CREATE: "create",
|
||||
EDIT: "edit",
|
||||
SWITCH: "switch",
|
||||
} as const;
|
||||
|
||||
export type EEstimateUpdateStages = typeof EEstimateUpdateStages[keyof typeof EEstimateUpdateStages];
|
||||
|
||||
export const estimateCount = {
|
||||
min: 2,
|
||||
|
||||
@@ -4,9 +4,11 @@ import { StoreContext } from "@/lib/store-context";
|
||||
// mobx store
|
||||
import { IProjectPageStore } from "@/store/pages/project-page.store";
|
||||
|
||||
export enum EPageStoreType {
|
||||
PROJECT = "PROJECT_PAGE",
|
||||
}
|
||||
export const EPageStoreType = {
|
||||
PROJECT: "PROJECT_PAGE",
|
||||
} as const;
|
||||
|
||||
export type EPageStoreType = typeof EPageStoreType[keyof typeof EPageStoreType];
|
||||
|
||||
export type TReturnType = {
|
||||
[EPageStoreType.PROJECT]: IProjectPageStore;
|
||||
|
||||
@@ -66,33 +66,33 @@ export const AuthRoot: FC<TAuthRoot> = observer((props) => {
|
||||
const errorhandler = authErrorHandler(error_code?.toString() as EAuthenticationErrorCodes);
|
||||
if (errorhandler) {
|
||||
// password error handler
|
||||
if ([EAuthenticationErrorCodes.AUTHENTICATION_FAILED_SIGN_UP].includes(errorhandler.code)) {
|
||||
if (([EAuthenticationErrorCodes.AUTHENTICATION_FAILED_SIGN_UP] as EAuthenticationErrorCodes[]).includes(errorhandler.code)) {
|
||||
setAuthMode(EAuthModes.SIGN_UP);
|
||||
setAuthStep(EAuthSteps.PASSWORD);
|
||||
}
|
||||
if ([EAuthenticationErrorCodes.AUTHENTICATION_FAILED_SIGN_IN].includes(errorhandler.code)) {
|
||||
if (([EAuthenticationErrorCodes.AUTHENTICATION_FAILED_SIGN_IN] as EAuthenticationErrorCodes[]).includes(errorhandler.code)) {
|
||||
setAuthMode(EAuthModes.SIGN_IN);
|
||||
setAuthStep(EAuthSteps.PASSWORD);
|
||||
}
|
||||
// magic_code error handler
|
||||
if (
|
||||
[
|
||||
([
|
||||
EAuthenticationErrorCodes.INVALID_MAGIC_CODE_SIGN_UP,
|
||||
EAuthenticationErrorCodes.INVALID_EMAIL_MAGIC_SIGN_UP,
|
||||
EAuthenticationErrorCodes.EXPIRED_MAGIC_CODE_SIGN_UP,
|
||||
EAuthenticationErrorCodes.EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP,
|
||||
].includes(errorhandler.code)
|
||||
] as EAuthenticationErrorCodes[]).includes(errorhandler.code)
|
||||
) {
|
||||
setAuthMode(EAuthModes.SIGN_UP);
|
||||
setAuthStep(EAuthSteps.UNIQUE_CODE);
|
||||
}
|
||||
if (
|
||||
[
|
||||
([
|
||||
EAuthenticationErrorCodes.INVALID_MAGIC_CODE_SIGN_IN,
|
||||
EAuthenticationErrorCodes.INVALID_EMAIL_MAGIC_SIGN_IN,
|
||||
EAuthenticationErrorCodes.EXPIRED_MAGIC_CODE_SIGN_IN,
|
||||
EAuthenticationErrorCodes.EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN,
|
||||
].includes(errorhandler.code)
|
||||
] as EAuthenticationErrorCodes[]).includes(errorhandler.code)
|
||||
) {
|
||||
setAuthMode(EAuthModes.SIGN_IN);
|
||||
setAuthStep(EAuthSteps.UNIQUE_CODE);
|
||||
|
||||
@@ -4,12 +4,16 @@ import { useTranslation } from "@plane/i18n";
|
||||
import { Tooltip } from "@plane/ui";
|
||||
// plane utils
|
||||
import { cn } from "@plane/utils";
|
||||
// types
|
||||
import { EPageAccess, EViewAccess } from "@plane/constants";
|
||||
|
||||
type AccessValue = EPageAccess | EViewAccess;
|
||||
|
||||
type Props = {
|
||||
onChange: (value: number) => void;
|
||||
value: number;
|
||||
onChange: (value: AccessValue) => void;
|
||||
value: AccessValue;
|
||||
accessSpecifiers: {
|
||||
key: number;
|
||||
key: AccessValue;
|
||||
i18n_label?: string;
|
||||
label?: string;
|
||||
icon: LucideIcon;
|
||||
|
||||
@@ -87,7 +87,7 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
|
||||
false;
|
||||
|
||||
if (!isRepeated) {
|
||||
if (currentEstimateType && [EEstimateSystem.TIME, EEstimateSystem.POINTS].includes(currentEstimateType)) {
|
||||
if (currentEstimateType && ([EEstimateSystem.TIME, EEstimateSystem.POINTS] as EEstimateSystem[]).includes(currentEstimateType)) {
|
||||
if (estimateInputValue && !isNaN(Number(estimateInputValue))) {
|
||||
if (Number(estimateInputValue) <= 0) {
|
||||
if (handleEstimatePointError)
|
||||
@@ -146,7 +146,7 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
|
||||
handleEstimatePointError &&
|
||||
handleEstimatePointError(
|
||||
estimateInputValue,
|
||||
[EEstimateSystem.POINTS, EEstimateSystem.TIME].includes(estimateType)
|
||||
([EEstimateSystem.POINTS, EEstimateSystem.TIME] as EEstimateSystem[]).includes(estimateType)
|
||||
? t("project_settings.estimates.validation.numeric")
|
||||
: t("project_settings.estimates.validation.character")
|
||||
);
|
||||
|
||||
@@ -92,7 +92,7 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
|
||||
false;
|
||||
|
||||
if (!isRepeated) {
|
||||
if (currentEstimateType && [EEstimateSystem.TIME, EEstimateSystem.POINTS].includes(currentEstimateType)) {
|
||||
if (currentEstimateType && ([EEstimateSystem.TIME, EEstimateSystem.POINTS] as EEstimateSystem[]).includes(currentEstimateType)) {
|
||||
if (estimateInputValue && !isNaN(Number(estimateInputValue))) {
|
||||
if (Number(estimateInputValue) <= 0) {
|
||||
if (handleEstimatePointError)
|
||||
@@ -153,7 +153,7 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
|
||||
if (handleEstimatePointError)
|
||||
handleEstimatePointError(
|
||||
estimateInputValue,
|
||||
[EEstimateSystem.POINTS, EEstimateSystem.TIME].includes(estimateType)
|
||||
([EEstimateSystem.POINTS, EEstimateSystem.TIME] as EEstimateSystem[]).includes(estimateType)
|
||||
? t("project_settings.estimates.validation.numeric")
|
||||
: t("project_settings.estimates.validation.character")
|
||||
);
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
export enum ETimeLineTypeType {
|
||||
ISSUE = "ISSUE",
|
||||
MODULE = "MODULE",
|
||||
PROJECT = "PROJECT",
|
||||
}
|
||||
export const ETimeLineTypeType = {
|
||||
ISSUE: "ISSUE",
|
||||
MODULE: "MODULE",
|
||||
PROJECT: "PROJECT",
|
||||
} as const;
|
||||
|
||||
export type ETimeLineTypeType = typeof ETimeLineTypeType[keyof typeof ETimeLineTypeType];
|
||||
|
||||
export const TimeLineTypeContext = createContext<ETimeLineTypeType | undefined>(undefined);
|
||||
|
||||
|
||||
@@ -4,15 +4,17 @@ import { RecentActivityWidgetLoader } from "./recent-activity";
|
||||
|
||||
// types
|
||||
|
||||
export const EWidgetKeys = {
|
||||
RECENT_ACTIVITY: "recent_activity",
|
||||
QUICK_LINKS: "quick_links",
|
||||
} as const;
|
||||
|
||||
export type EWidgetKeys = typeof EWidgetKeys[keyof typeof EWidgetKeys];
|
||||
|
||||
type Props = {
|
||||
widgetKey: EWidgetKeys;
|
||||
};
|
||||
|
||||
export enum EWidgetKeys {
|
||||
RECENT_ACTIVITY = "recent_activity",
|
||||
QUICK_LINKS = "quick_links",
|
||||
}
|
||||
|
||||
export const WidgetLoader: React.FC<Props> = (props) => {
|
||||
const { widgetKey } = props;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ type Props = {
|
||||
projectId: string;
|
||||
workspaceSlug: string;
|
||||
canUserCreateIssue: boolean | undefined;
|
||||
storeType?: EIssuesStoreType.PROJECT | EIssuesStoreType.EPIC;
|
||||
storeType?: typeof EIssuesStoreType.PROJECT | typeof EIssuesStoreType.EPIC;
|
||||
};
|
||||
const HeaderFilters = observer((props: Props) => {
|
||||
const {
|
||||
|
||||
@@ -43,7 +43,7 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
||||
"issue_activity_filters",
|
||||
defaultActivityFilters
|
||||
);
|
||||
const { setValue: setSortOrder, storedValue: sortOrder } = useLocalStorage("activity_sort_order", E_SORT_ORDER.ASC);
|
||||
const { setValue: setSortOrder, storedValue: sortOrder } = useLocalStorage<E_SORT_ORDER>("activity_sort_order", E_SORT_ORDER.ASC);
|
||||
// store hooks
|
||||
const {
|
||||
issue: { getIssueById },
|
||||
|
||||
@@ -18,13 +18,13 @@ import { IQuickActionProps } from "../list/list-view-types";
|
||||
import { handleDragDrop } from "./utils";
|
||||
|
||||
export type CalendarStoreType =
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.TEAM
|
||||
| EIssuesStoreType.TEAM_VIEW
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.TEAM
|
||||
| typeof EIssuesStoreType.TEAM_VIEW
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
interface IBaseCalendarRoot {
|
||||
QuickActions: FC<IQuickActionProps>;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import { useIssues } from "@/hooks/store/use-issues";
|
||||
// plane web constants
|
||||
|
||||
type TProjectAppliedFiltersRootProps = {
|
||||
storeType?: EIssuesStoreType.PROJECT | EIssuesStoreType.EPIC;
|
||||
storeType?: typeof EIssuesStoreType.PROJECT | typeof EIssuesStoreType.EPIC;
|
||||
};
|
||||
|
||||
export const ProjectAppliedFiltersRoot: React.FC<TProjectAppliedFiltersRootProps> = observer((props) => {
|
||||
|
||||
@@ -36,11 +36,11 @@ interface IBaseGanttRoot {
|
||||
}
|
||||
|
||||
export type GanttStoreType =
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
export const BaseGanttRoot: React.FC<IBaseGanttRoot> = observer((props: IBaseGanttRoot) => {
|
||||
const { viewId, isCompletedCycle = false, isEpic = false } = props;
|
||||
|
||||
@@ -33,15 +33,15 @@ import { KanBan } from "./default";
|
||||
import { KanBanSwimLanes } from "./swimlanes";
|
||||
|
||||
export type KanbanStoreType =
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.DRAFT
|
||||
| EIssuesStoreType.PROFILE
|
||||
| EIssuesStoreType.TEAM
|
||||
| EIssuesStoreType.TEAM_VIEW
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.DRAFT
|
||||
| typeof EIssuesStoreType.PROFILE
|
||||
| typeof EIssuesStoreType.TEAM
|
||||
| typeof EIssuesStoreType.TEAM_VIEW
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
export interface IBaseKanBanLayout {
|
||||
QuickActions: FC<IQuickActionProps>;
|
||||
|
||||
@@ -25,17 +25,17 @@ import { List } from "./default";
|
||||
import { IQuickActionProps, TRenderQuickActions } from "./list-view-types";
|
||||
|
||||
type ListStoreType =
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.DRAFT
|
||||
| EIssuesStoreType.PROFILE
|
||||
| EIssuesStoreType.ARCHIVED
|
||||
| EIssuesStoreType.WORKSPACE_DRAFT
|
||||
| EIssuesStoreType.TEAM
|
||||
| EIssuesStoreType.TEAM_VIEW
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.DRAFT
|
||||
| typeof EIssuesStoreType.PROFILE
|
||||
| typeof EIssuesStoreType.ARCHIVED
|
||||
| typeof EIssuesStoreType.WORKSPACE_DRAFT
|
||||
| typeof EIssuesStoreType.TEAM
|
||||
| typeof EIssuesStoreType.TEAM_VIEW
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
interface IBaseListRoot {
|
||||
QuickActions: FC<IQuickActionProps>;
|
||||
|
||||
@@ -14,13 +14,13 @@ import { IQuickActionProps, TRenderQuickActions } from "../list/list-view-types"
|
||||
import { SpreadsheetView } from "./spreadsheet-view";
|
||||
|
||||
export type SpreadsheetStoreType =
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.TEAM
|
||||
| EIssuesStoreType.TEAM_VIEW
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.TEAM
|
||||
| typeof EIssuesStoreType.TEAM_VIEW
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
interface IBaseSpreadsheetRoot {
|
||||
QuickActions: FC<IQuickActionProps>;
|
||||
|
||||
@@ -67,7 +67,7 @@ type TGetColumns = {
|
||||
};
|
||||
|
||||
export const isWorkspaceLevel = (type: EIssuesStoreType) =>
|
||||
[EIssuesStoreType.PROFILE, EIssuesStoreType.GLOBAL].includes(type) ? true : false;
|
||||
([EIssuesStoreType.PROFILE, EIssuesStoreType.GLOBAL] as EIssuesStoreType[]).includes(type) ? true : false;
|
||||
|
||||
type TGetGroupByColumns = {
|
||||
groupBy: GroupByColumnTypes | null;
|
||||
|
||||
@@ -12,7 +12,7 @@ type TDiscountInfoProps = {
|
||||
subscriptionType: EProductSubscriptionEnum;
|
||||
};
|
||||
|
||||
const PLANS_WITH_DISCOUNT = [EProductSubscriptionEnum.PRO];
|
||||
const PLANS_WITH_DISCOUNT = [EProductSubscriptionEnum.PRO] as EProductSubscriptionEnum[];
|
||||
|
||||
const getActualPrice = (frequency: TBillingFrequency, subscriptionType: EProductSubscriptionEnum): number | null => {
|
||||
switch (subscriptionType) {
|
||||
|
||||
@@ -17,10 +17,12 @@ import CreateJoinWorkspaceDark from "@/public/onboarding/create-join-workspace-d
|
||||
import CreateJoinWorkspace from "@/public/onboarding/create-join-workspace-light.webp";
|
||||
import { LogoSpinner } from "../common";
|
||||
|
||||
export enum ECreateOrJoinWorkspaceViews {
|
||||
WORKSPACE_CREATE = "WORKSPACE_CREATE",
|
||||
WORKSPACE_JOIN = "WORKSPACE_JOIN",
|
||||
}
|
||||
export const ECreateOrJoinWorkspaceViews = {
|
||||
WORKSPACE_CREATE: "WORKSPACE_CREATE",
|
||||
WORKSPACE_JOIN: "WORKSPACE_JOIN",
|
||||
} as const;
|
||||
|
||||
export type ECreateOrJoinWorkspaceViews = typeof ECreateOrJoinWorkspaceViews[keyof typeof ECreateOrJoinWorkspaceViews];
|
||||
|
||||
type Props = {
|
||||
invitations: IWorkspaceMemberInvitation[];
|
||||
|
||||
@@ -57,11 +57,13 @@ type Props = {
|
||||
finishOnboarding: () => Promise<void>;
|
||||
};
|
||||
|
||||
enum EProfileSetupSteps {
|
||||
ALL = "ALL",
|
||||
USER_DETAILS = "USER_DETAILS",
|
||||
USER_PERSONALIZATION = "USER_PERSONALIZATION",
|
||||
}
|
||||
const EProfileSetupSteps = {
|
||||
ALL: "ALL",
|
||||
USER_DETAILS: "USER_DETAILS",
|
||||
USER_PERSONALIZATION: "USER_PERSONALIZATION",
|
||||
} as const;
|
||||
|
||||
type EProfileSetupSteps = typeof EProfileSetupSteps[keyof typeof EProfileSetupSteps];
|
||||
|
||||
const USER_ROLE = ["Individual contributor", "Senior Leader", "Manager", "Executive", "Freelancer", "Student"];
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export const StartOfWeekPreference = observer((props: { option: { title: string;
|
||||
<CustomSelect
|
||||
value={userProfile.start_of_the_week}
|
||||
label={getStartOfWeekLabel(userProfile.start_of_the_week)}
|
||||
onChange={(val: number) => {
|
||||
onChange={(val: EStartOfTheWeek) => {
|
||||
updateUserProfile({ start_of_the_week: val })
|
||||
.then(() => {
|
||||
setToast({
|
||||
|
||||
@@ -24,10 +24,12 @@ type Props = {
|
||||
templateId?: string;
|
||||
};
|
||||
|
||||
enum EProjectCreationSteps {
|
||||
CREATE_PROJECT = "CREATE_PROJECT",
|
||||
FEATURE_SELECTION = "FEATURE_SELECTION",
|
||||
}
|
||||
const EProjectCreationSteps = {
|
||||
CREATE_PROJECT: "CREATE_PROJECT",
|
||||
FEATURE_SELECTION: "FEATURE_SELECTION",
|
||||
} as const;
|
||||
|
||||
type EProjectCreationSteps = typeof EProjectCreationSteps[keyof typeof EProjectCreationSteps];
|
||||
|
||||
export const CreateProjectModal: FC<Props> = (props) => {
|
||||
const { isOpen, onClose, setToFavorite = false, workspaceSlug, data, templateId } = props;
|
||||
|
||||
@@ -171,12 +171,12 @@ export const SendProjectInvitationModal: React.FC<Props> = observer((props) => {
|
||||
const currentMemberWorkspaceRole = getWorkspaceMemberDetails(value)?.role;
|
||||
if (!value || !currentMemberWorkspaceRole) return ROLE;
|
||||
|
||||
const isGuestOROwner = [EUserPermissions.ADMIN, EUserPermissions.GUEST].includes(
|
||||
const isGuestOROwner = ([EUserPermissions.ADMIN, EUserPermissions.GUEST] as EUserPermissions[]).includes(
|
||||
currentMemberWorkspaceRole as EUserPermissions
|
||||
);
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries(ROLE).filter(([key]) => !isGuestOROwner || [currentMemberWorkspaceRole].includes(parseInt(key)))
|
||||
Object.entries(ROLE).filter(([key]) => !isGuestOROwner || ([currentMemberWorkspaceRole] as EUserPermissions[]).includes(parseInt(key) as EUserPermissions))
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -102,18 +102,18 @@ export const AccountTypeColumn: React.FC<AccountTypeProps> = observer((props) =>
|
||||
// derived values
|
||||
const roleLabel = ROLE[rowData.original_role ?? EUserPermissions.GUEST];
|
||||
const isCurrentUser = currentUser?.id === rowData.member.id;
|
||||
const isRowDataWorkspaceAdmin = [EUserPermissions.ADMIN].includes(
|
||||
Number(getWorkspaceMemberDetails(rowData.member.id)?.role) ?? EUserPermissions.GUEST
|
||||
const isRowDataWorkspaceAdmin = ([EUserPermissions.ADMIN] as EUserPermissions[]).includes(
|
||||
(Number(getWorkspaceMemberDetails(rowData.member.id)?.role) ?? EUserPermissions.GUEST) as EUserPermissions
|
||||
);
|
||||
const isCurrentUserWorkspaceAdmin = currentUser
|
||||
? [EUserPermissions.ADMIN].includes(
|
||||
Number(getWorkspaceMemberDetails(currentUser.id)?.role) ?? EUserPermissions.GUEST
|
||||
? ([EUserPermissions.ADMIN] as EUserPermissions[]).includes(
|
||||
(Number(getWorkspaceMemberDetails(currentUser.id)?.role) ?? EUserPermissions.GUEST) as EUserPermissions
|
||||
)
|
||||
: false;
|
||||
const currentProjectRole = getProjectRoleByWorkspaceSlugAndProjectId(workspaceSlug, projectId);
|
||||
|
||||
const isCurrentUserProjectAdmin = currentProjectRole
|
||||
? ![EUserPermissions.MEMBER, EUserPermissions.GUEST].includes(Number(currentProjectRole) ?? EUserPermissions.GUEST)
|
||||
? !([EUserPermissions.MEMBER, EUserPermissions.GUEST] as EUserPermissions[]).includes((Number(currentProjectRole) ?? EUserPermissions.GUEST) as EUserPermissions)
|
||||
: false;
|
||||
|
||||
// logic
|
||||
@@ -126,7 +126,7 @@ export const AccountTypeColumn: React.FC<AccountTypeProps> = observer((props) =>
|
||||
const currentMemberWorkspaceRole = getWorkspaceMemberDetails(value)?.role as EUserPermissions | undefined;
|
||||
if (!value || !currentMemberWorkspaceRole) return ROLE;
|
||||
|
||||
const isGuest = [EUserPermissions.GUEST].includes(currentMemberWorkspaceRole);
|
||||
const isGuest = ([EUserPermissions.GUEST] as EUserPermissions[]).includes(currentMemberWorkspaceRole);
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries(ROLE).filter(([key]) => !isGuest || parseInt(key) === EUserPermissions.GUEST)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { observer } from "mobx-react";
|
||||
import { EUserPermissions } from "@plane/constants";
|
||||
import { WorkspaceLogo } from "@/components/workspace";
|
||||
import { getUserRole } from "@/helpers/user.helper";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
@@ -22,7 +23,7 @@ export const SettingsSidebarHeader = observer((props: { customHeader?: React.Rea
|
||||
{currentWorkspace.name ?? "Workspace"}
|
||||
</div>
|
||||
<div className="text-sm text-custom-text-300 capitalize">
|
||||
{getUserRole(currentWorkspace.role)?.toLowerCase() || "guest"}
|
||||
{getUserRole(currentWorkspace.role as EUserPermissions)?.toLowerCase() || "guest"}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@ const SidebarDropdownItem = observer((props: TProps) => {
|
||||
{workspace.name}
|
||||
</div>
|
||||
<div className="text-sm text-custom-text-300 flex gap-2 capitalize w-fit">
|
||||
<span>{getUserRole(workspace.role)?.toLowerCase() || "guest"}</span>
|
||||
<span>{getUserRole(workspace.role as EUserPermissions)?.toLowerCase() || "guest"}</span>
|
||||
<div className="w-1 h-1 bg-custom-text-300/50 rounded-full m-auto" />
|
||||
<span className="capitalize">{t("member", { count: workspace.total_members || 0 })}</span>
|
||||
</div>
|
||||
@@ -87,7 +87,7 @@ const SidebarDropdownItem = observer((props: TProps) => {
|
||||
{workspace.id === activeWorkspace?.id && (
|
||||
<>
|
||||
<div className="mt-2 mb-1 flex gap-2">
|
||||
{[EUserPermissions.ADMIN, EUserPermissions.MEMBER].includes(workspace?.role) && (
|
||||
{([EUserPermissions.ADMIN, EUserPermissions.MEMBER] as EUserPermissions[]).includes(workspace?.role as EUserPermissions) && (
|
||||
<Link
|
||||
href={`/${workspace.slug}/settings`}
|
||||
onClick={handleClose}
|
||||
@@ -97,7 +97,7 @@ const SidebarDropdownItem = observer((props: TProps) => {
|
||||
<span className="text-sm font-medium my-auto">{t("settings")}</span>
|
||||
</Link>
|
||||
)}
|
||||
{[EUserPermissions.ADMIN].includes(workspace?.role) && (
|
||||
{([EUserPermissions.ADMIN] as EUserPermissions[]).includes(workspace?.role as EUserPermissions) && (
|
||||
<Link
|
||||
href={`/${workspace.slug}/settings/members`}
|
||||
onClick={handleClose}
|
||||
|
||||
@@ -10,17 +10,17 @@ import { useIssueDetail, useIssues } from "./store";
|
||||
import { useIssuesActions } from "./use-issues-actions";
|
||||
|
||||
type DNDStoreType =
|
||||
| EIssuesStoreType.PROJECT
|
||||
| EIssuesStoreType.MODULE
|
||||
| EIssuesStoreType.CYCLE
|
||||
| EIssuesStoreType.PROJECT_VIEW
|
||||
| EIssuesStoreType.DRAFT
|
||||
| EIssuesStoreType.PROFILE
|
||||
| EIssuesStoreType.ARCHIVED
|
||||
| EIssuesStoreType.WORKSPACE_DRAFT
|
||||
| EIssuesStoreType.TEAM
|
||||
| EIssuesStoreType.TEAM_VIEW
|
||||
| EIssuesStoreType.EPIC;
|
||||
| typeof EIssuesStoreType.PROJECT
|
||||
| typeof EIssuesStoreType.MODULE
|
||||
| typeof EIssuesStoreType.CYCLE
|
||||
| typeof EIssuesStoreType.PROJECT_VIEW
|
||||
| typeof EIssuesStoreType.DRAFT
|
||||
| typeof EIssuesStoreType.PROFILE
|
||||
| typeof EIssuesStoreType.ARCHIVED
|
||||
| typeof EIssuesStoreType.WORKSPACE_DRAFT
|
||||
| typeof EIssuesStoreType.TEAM
|
||||
| typeof EIssuesStoreType.TEAM_VIEW
|
||||
| typeof EIssuesStoreType.EPIC;
|
||||
|
||||
export const useGroupIssuesDragNDrop = (
|
||||
storeType: DNDStoreType,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useMemo } from "react";
|
||||
// plane imports
|
||||
import { IS_FAVORITE_MENU_OPEN } from "@plane/constants";
|
||||
import { EditorRefApi } from "@plane/editor";
|
||||
import { EPageAccess } from "@plane/types/src/enums";
|
||||
import { EPageAccess } from "@plane/constants";
|
||||
import { setToast, TOAST_TYPE } from "@plane/ui";
|
||||
import { copyUrlToClipboard } from "@plane/utils";
|
||||
// hooks
|
||||
|
||||
@@ -32,16 +32,18 @@ export interface UnSplashImageUrls {
|
||||
small_s3: string;
|
||||
}
|
||||
|
||||
export enum TFileAssetType {
|
||||
COMMENT_DESCRIPTION = "COMMENT_DESCRIPTION",
|
||||
ISSUE_ATTACHMENT = "ISSUE_ATTACHMENT",
|
||||
ISSUE_DESCRIPTION = "ISSUE_DESCRIPTION",
|
||||
PAGE_DESCRIPTION = "PAGE_DESCRIPTION",
|
||||
PROJECT_COVER = "PROJECT_COVER",
|
||||
USER_AVATAR = "USER_AVATAR",
|
||||
USER_COVER = "USER_COVER",
|
||||
WORKSPACE_LOGO = "WORKSPACE_LOGO",
|
||||
}
|
||||
export const TFileAssetType = {
|
||||
COMMENT_DESCRIPTION: "COMMENT_DESCRIPTION",
|
||||
ISSUE_ATTACHMENT: "ISSUE_ATTACHMENT",
|
||||
ISSUE_DESCRIPTION: "ISSUE_DESCRIPTION",
|
||||
PAGE_DESCRIPTION: "PAGE_DESCRIPTION",
|
||||
PROJECT_COVER: "PROJECT_COVER",
|
||||
USER_AVATAR: "USER_AVATAR",
|
||||
USER_COVER: "USER_COVER",
|
||||
WORKSPACE_LOGO: "WORKSPACE_LOGO",
|
||||
} as const;
|
||||
|
||||
export type TFileAssetType = typeof TFileAssetType[keyof typeof TFileAssetType];
|
||||
|
||||
export class FileService extends APIService {
|
||||
private cancelSource: any;
|
||||
|
||||
@@ -5,7 +5,7 @@ import set from "lodash/set";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { TInboxIssue, TInboxIssueCurrentTab } from "@plane/constants";
|
||||
import { TInboxIssue, TInboxIssueCurrentTab, EInboxIssueCurrentTab, EInboxIssueStatus } from "@plane/constants";
|
||||
import {
|
||||
TInboxIssueFilter,
|
||||
TInboxIssueSorting,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
TInboxIssueSortingOrderByQueryParam,
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
import { EInboxIssueCurrentTab, EInboxIssueStatus, EPastDurationFilters, getCustomDates } from "@/helpers/inbox.helper";
|
||||
import { EPastDurationFilters, getCustomDates } from "@/helpers/inbox.helper";
|
||||
// services
|
||||
import { InboxIssueService } from "@/services/inbox";
|
||||
// root store
|
||||
@@ -150,11 +150,11 @@ export class ProjectInboxStore implements IProjectInboxStore {
|
||||
}
|
||||
|
||||
get filteredInboxIssueIds() {
|
||||
let appliedFilters =
|
||||
this.currentTab === EInboxIssueCurrentTab.OPEN
|
||||
? [EInboxIssueStatus.PENDING, EInboxIssueStatus.SNOOZED]
|
||||
: [EInboxIssueStatus.ACCEPTED, EInboxIssueStatus.DECLINED, EInboxIssueStatus.DUPLICATE];
|
||||
appliedFilters = appliedFilters.filter((filter) => this.inboxFilters?.status?.includes(filter));
|
||||
const openFilters = [EInboxIssueStatus.PENDING, EInboxIssueStatus.SNOOZED] as EInboxIssueStatus[];
|
||||
const closedFilters = [EInboxIssueStatus.ACCEPTED, EInboxIssueStatus.DECLINED, EInboxIssueStatus.DUPLICATE] as EInboxIssueStatus[];
|
||||
|
||||
const baseFilters = this.currentTab === EInboxIssueCurrentTab.OPEN ? openFilters : closedFilters;
|
||||
const appliedFilters = baseFilters.filter((filter) => this.inboxFilters?.status?.includes(filter));
|
||||
const currentTime = new Date().getTime();
|
||||
|
||||
return this.currentTab === EInboxIssueCurrentTab.OPEN
|
||||
@@ -264,8 +264,8 @@ export class ProjectInboxStore implements IProjectInboxStore {
|
||||
set(this.filtersMap, [projectId], {
|
||||
status:
|
||||
tab === EInboxIssueCurrentTab.OPEN
|
||||
? [EInboxIssueStatus.PENDING]
|
||||
: [EInboxIssueStatus.ACCEPTED, EInboxIssueStatus.DECLINED, EInboxIssueStatus.DUPLICATE],
|
||||
? ([EInboxIssueStatus.PENDING] as EInboxIssueStatus[])
|
||||
: ([EInboxIssueStatus.ACCEPTED, EInboxIssueStatus.DECLINED, EInboxIssueStatus.DUPLICATE] as EInboxIssueStatus[]),
|
||||
});
|
||||
});
|
||||
this.fetchInboxIssues(workspaceSlug, projectId, "filter-loading");
|
||||
@@ -300,8 +300,8 @@ export class ProjectInboxStore implements IProjectInboxStore {
|
||||
set(this.filtersMap, [projectId], {
|
||||
status:
|
||||
tab === EInboxIssueCurrentTab.OPEN
|
||||
? [EInboxIssueStatus.PENDING]
|
||||
: [EInboxIssueStatus.ACCEPTED, EInboxIssueStatus.DECLINED, EInboxIssueStatus.DUPLICATE],
|
||||
? ([EInboxIssueStatus.PENDING] as EInboxIssueStatus[])
|
||||
: ([EInboxIssueStatus.ACCEPTED, EInboxIssueStatus.DECLINED, EInboxIssueStatus.DUPLICATE] as EInboxIssueStatus[]),
|
||||
});
|
||||
}
|
||||
if (isEmpty(this.inboxSorting)) {
|
||||
|
||||
@@ -73,12 +73,12 @@ export const getGroupIssueKeyActions = (
|
||||
*/
|
||||
export const getSubGroupIssueKeyActions = (
|
||||
groupActionsArray: {
|
||||
[EIssueGroupedAction.ADD]: string[];
|
||||
[EIssueGroupedAction.DELETE]: string[];
|
||||
ADD: string[];
|
||||
DELETE: string[];
|
||||
},
|
||||
subGroupActionsArray: {
|
||||
[EIssueGroupedAction.ADD]: string[];
|
||||
[EIssueGroupedAction.DELETE]: string[];
|
||||
ADD: string[];
|
||||
DELETE: string[];
|
||||
},
|
||||
previousIssueGroupProperties: string[],
|
||||
currentIssueGroupProperties: string[],
|
||||
@@ -89,7 +89,7 @@ export const getSubGroupIssueKeyActions = (
|
||||
|
||||
// For every groupId path for issue Id List, that needs to be added,
|
||||
// It needs to be added at all the current Issue Properties that on which subGrouping depends on
|
||||
for (const addKey of groupActionsArray[EIssueGroupedAction.ADD]) {
|
||||
for (const addKey of groupActionsArray.ADD) {
|
||||
for (const subGroupProperty of currentIssueSubGroupProperties) {
|
||||
issueKeyActions[getGroupKey(addKey, subGroupProperty)] = {
|
||||
path: [addKey, subGroupProperty],
|
||||
@@ -100,7 +100,7 @@ export const getSubGroupIssueKeyActions = (
|
||||
|
||||
// For every groupId path for issue Id List, that needs to be deleted,
|
||||
// It needs to be deleted at all the previous Issue Properties that on which subGrouping depends on
|
||||
for (const deleteKey of groupActionsArray[EIssueGroupedAction.DELETE]) {
|
||||
for (const deleteKey of groupActionsArray.DELETE) {
|
||||
for (const subGroupProperty of previousIssueSubGroupProperties) {
|
||||
issueKeyActions[getGroupKey(deleteKey, subGroupProperty)] = {
|
||||
path: [deleteKey, subGroupProperty],
|
||||
@@ -111,7 +111,7 @@ export const getSubGroupIssueKeyActions = (
|
||||
|
||||
// For every subGroupId path for issue Id List, that needs to be added,
|
||||
// It needs to be added at all the current Issue Properties that on which grouping depends on
|
||||
for (const addKey of subGroupActionsArray[EIssueGroupedAction.ADD]) {
|
||||
for (const addKey of subGroupActionsArray.ADD) {
|
||||
for (const groupProperty of currentIssueGroupProperties) {
|
||||
issueKeyActions[getGroupKey(groupProperty, addKey)] = {
|
||||
path: [groupProperty, addKey],
|
||||
@@ -122,7 +122,7 @@ export const getSubGroupIssueKeyActions = (
|
||||
|
||||
// For every subGroupId path for issue Id List, that needs to be deleted,
|
||||
// It needs to be deleted at all the previous Issue Properties that on which grouping depends on
|
||||
for (const deleteKey of subGroupActionsArray[EIssueGroupedAction.DELETE]) {
|
||||
for (const deleteKey of subGroupActionsArray.DELETE) {
|
||||
for (const groupProperty of previousIssueGroupProperties) {
|
||||
issueKeyActions[getGroupKey(groupProperty, deleteKey)] = {
|
||||
path: [groupProperty, deleteKey],
|
||||
@@ -146,8 +146,8 @@ export const getSubGroupIssueKeyActions = (
|
||||
export const getDifference = (
|
||||
current: string[],
|
||||
previous: string[],
|
||||
action?: EIssueGroupedAction.ADD | EIssueGroupedAction.DELETE
|
||||
): { [EIssueGroupedAction.ADD]: string[]; [EIssueGroupedAction.DELETE]: string[] } => {
|
||||
action?: typeof EIssueGroupedAction.ADD | typeof EIssueGroupedAction.DELETE
|
||||
): { ADD: string[]; DELETE: string[] } => {
|
||||
const ADD = [];
|
||||
const DELETE = [];
|
||||
|
||||
@@ -164,12 +164,12 @@ export const getDifference = (
|
||||
}
|
||||
|
||||
// if there are no action provided, return the arrays
|
||||
if (!action) return { [EIssueGroupedAction.ADD]: ADD, [EIssueGroupedAction.DELETE]: DELETE };
|
||||
if (!action) return { ADD, DELETE };
|
||||
|
||||
// If there is an action provided, return the values of both arrays under that array
|
||||
if (action === EIssueGroupedAction.ADD)
|
||||
return { [EIssueGroupedAction.ADD]: uniq([...ADD]), [EIssueGroupedAction.DELETE]: [] };
|
||||
else return { [EIssueGroupedAction.DELETE]: uniq([...DELETE]), [EIssueGroupedAction.ADD]: [] };
|
||||
return { ADD: uniq([...ADD]), DELETE: [] };
|
||||
else return { DELETE: uniq([...DELETE]), ADD: [] };
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,11 +56,14 @@ import { IBaseIssueFilterStore } from "./issue-filter-helper.store";
|
||||
|
||||
export type TIssueDisplayFilterOptions = Exclude<TIssueGroupByOptions, null> | "target_date";
|
||||
|
||||
export enum EIssueGroupedAction {
|
||||
ADD = "ADD",
|
||||
DELETE = "DELETE",
|
||||
REORDER = "REORDER",
|
||||
}
|
||||
export const EIssueGroupedAction = {
|
||||
ADD: "ADD",
|
||||
DELETE: "DELETE",
|
||||
REORDER: "REORDER",
|
||||
} as const;
|
||||
|
||||
export type EIssueGroupedAction = typeof EIssueGroupedAction[keyof typeof EIssueGroupedAction];
|
||||
|
||||
export interface IBaseIssuesStore {
|
||||
// observable
|
||||
loader: Record<string, TLoader>;
|
||||
@@ -1273,7 +1276,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
updateIssueList(
|
||||
issue?: TIssue,
|
||||
issueBeforeUpdate?: TIssue,
|
||||
action?: EIssueGroupedAction.ADD | EIssueGroupedAction.DELETE
|
||||
action?: typeof EIssueGroupedAction.ADD | typeof EIssueGroupedAction.DELETE
|
||||
) {
|
||||
if (!issue && !issueBeforeUpdate) return;
|
||||
|
||||
@@ -1587,7 +1590,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
getUpdateDetails = (
|
||||
issue?: Partial<TIssue>,
|
||||
issueBeforeUpdate?: Partial<TIssue>,
|
||||
action?: EIssueGroupedAction.ADD | EIssueGroupedAction.DELETE
|
||||
action?: typeof EIssueGroupedAction.ADD | typeof EIssueGroupedAction.DELETE
|
||||
): { path: string[]; action: EIssueGroupedAction }[] => {
|
||||
// check the before and after states to return if there needs to be a re-sorting of issueId list if the issue property that orderBy depends on has changed
|
||||
const orderByUpdates = this.getOrderByUpdateDetails(issue, issueBeforeUpdate);
|
||||
@@ -1649,7 +1652,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
getOrderByUpdateDetails(
|
||||
issue: Partial<TIssue> | undefined,
|
||||
issueBeforeUpdate: Partial<TIssue> | undefined
|
||||
): { path: string[]; action: EIssueGroupedAction.REORDER }[] {
|
||||
): { path: string[]; action: typeof EIssueGroupedAction.REORDER }[] {
|
||||
// if before and after states of the issue prop on which orderBy depends on then return and empty Array
|
||||
if (
|
||||
!issue ||
|
||||
@@ -1664,7 +1667,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
|
||||
const issueGroupKey = issue?.[this.issueGroupKey] as string | string[] | null | undefined;
|
||||
// if they are grouped then identify the paths based on props on which group by is dependent on
|
||||
const issueKeyActions: { path: string[]; action: EIssueGroupedAction.REORDER }[] = [];
|
||||
const issueKeyActions: { path: string[]; action: typeof EIssueGroupedAction.REORDER }[] = [];
|
||||
const groupByValues = this.getArrayStringArray(issue, issueGroupKey);
|
||||
|
||||
// if issues are not subGrouped then, provide path from groupByValues
|
||||
|
||||
@@ -25,7 +25,7 @@ export const ROLE_PERMISSIONS_TO_CREATE_PAGE = [
|
||||
EUserPermissions.MEMBER,
|
||||
EUserProjectRoles.ADMIN,
|
||||
EUserProjectRoles.MEMBER,
|
||||
];
|
||||
] as (EUserPermissions | EUserProjectRoles)[];
|
||||
|
||||
export interface IProjectPageStore {
|
||||
// observables
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface IBaseUserPermissionStore {
|
||||
workspaceProjectsPermissions: Record<string, IUserProjectsRole>; // workspaceSlug -> IUserProjectsRole
|
||||
// computed helpers
|
||||
workspaceInfoBySlug: (workspaceSlug: string) => IWorkspaceMemberMe | undefined;
|
||||
getWorkspaceRoleByWorkspaceSlug: (workspaceSlug: string) => TUserPermissions | EUserWorkspaceRoles | undefined;
|
||||
getWorkspaceRoleByWorkspaceSlug: (workspaceSlug: string) => EUserWorkspaceRoles | undefined;
|
||||
getProjectRolesByWorkspaceSlug: (workspaceSlug: string) => IUserProjectsRole;
|
||||
getProjectRoleByWorkspaceSlugAndProjectId: (workspaceSlug: string, projectId: string) => EUserPermissions | undefined;
|
||||
allowPermissions: (
|
||||
@@ -100,9 +100,9 @@ export abstract class BaseUserPermissionStore implements IBaseUserPermissionStor
|
||||
* @returns { TUserPermissions | EUserWorkspaceRoles | undefined }
|
||||
*/
|
||||
getWorkspaceRoleByWorkspaceSlug = computedFn(
|
||||
(workspaceSlug: string): TUserPermissions | EUserWorkspaceRoles | undefined => {
|
||||
(workspaceSlug: string): EUserWorkspaceRoles | undefined => {
|
||||
if (!workspaceSlug) return undefined;
|
||||
return this.workspaceUserInfo[workspaceSlug]?.role as TUserPermissions | EUserWorkspaceRoles | undefined;
|
||||
return this.workspaceUserInfo[workspaceSlug]?.role;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -194,7 +194,7 @@ export abstract class BaseUserPermissionStore implements IBaseUserPermissionStor
|
||||
}
|
||||
|
||||
if (typeof currentUserRole === "string") {
|
||||
currentUserRole = parseInt(currentUserRole);
|
||||
currentUserRole = parseInt(currentUserRole) as EUserPermissions;
|
||||
}
|
||||
|
||||
if (currentUserRole && typeof currentUserRole === "number" && allowPermissions.includes(currentUserRole)) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { action, makeObservable, observable, runInAction, computed } from "mobx"
|
||||
// plane imports
|
||||
import { EUserPermissions } from "@plane/constants";
|
||||
import { IUser } from "@plane/types";
|
||||
import { TUserPermissions } from "@plane/types/src/enums";
|
||||
import { TUserPermissions } from "@plane/constants";
|
||||
// helpers
|
||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
||||
// local db
|
||||
@@ -51,7 +51,7 @@ export interface IUserStore {
|
||||
// computed
|
||||
localDBEnabled: boolean;
|
||||
canPerformAnyCreateAction: boolean;
|
||||
projectsWithCreatePermissions: { [projectId: string]: number } | null;
|
||||
projectsWithCreatePermissions: { [projectId: string]: EUserPermissions } | null;
|
||||
}
|
||||
|
||||
export class UserStore implements IUserStore {
|
||||
@@ -263,7 +263,7 @@ export class UserStore implements IUserStore {
|
||||
* @description fetches the prjects with write permissions
|
||||
* @returns {{[projectId: string]: number} || null}
|
||||
*/
|
||||
fetchProjectsWithCreatePermissions = (): { [key: string]: TUserPermissions } => {
|
||||
fetchProjectsWithCreatePermissions = (): { [key: string]: EUserPermissions } => {
|
||||
const { workspaceSlug } = this.store.router;
|
||||
|
||||
const allWorkspaceProjectRoles = this.permission.getProjectRolesByWorkspaceSlug(workspaceSlug || "");
|
||||
@@ -273,7 +273,7 @@ export class UserStore implements IUserStore {
|
||||
Object.keys(allWorkspaceProjectRoles)
|
||||
.filter((key) => allWorkspaceProjectRoles[key] >= EUserPermissions.MEMBER)
|
||||
.reduce(
|
||||
(res: { [projectId: string]: number }, key: string) => ((res[key] = allWorkspaceProjectRoles[key]), res),
|
||||
(res: { [projectId: string]: EUserPermissions }, key: string) => ((res[key] = allWorkspaceProjectRoles[key] as EUserPermissions), res),
|
||||
{}
|
||||
)) ||
|
||||
null;
|
||||
|
||||
@@ -3,96 +3,106 @@ import Link from "next/link";
|
||||
// helpers
|
||||
import { SUPPORT_EMAIL } from "./common.helper";
|
||||
|
||||
export enum EPageTypes {
|
||||
PUBLIC = "PUBLIC",
|
||||
NON_AUTHENTICATED = "NON_AUTHENTICATED",
|
||||
SET_PASSWORD = "SET_PASSWORD",
|
||||
ONBOARDING = "ONBOARDING",
|
||||
AUTHENTICATED = "AUTHENTICATED",
|
||||
}
|
||||
export const EPageTypes = {
|
||||
PUBLIC: "PUBLIC",
|
||||
NON_AUTHENTICATED: "NON_AUTHENTICATED",
|
||||
SET_PASSWORD: "SET_PASSWORD",
|
||||
ONBOARDING: "ONBOARDING",
|
||||
AUTHENTICATED: "AUTHENTICATED",
|
||||
} as const;
|
||||
|
||||
export enum EAuthModes {
|
||||
SIGN_IN = "SIGN_IN",
|
||||
SIGN_UP = "SIGN_UP",
|
||||
}
|
||||
export type EPageTypes = typeof EPageTypes[keyof typeof EPageTypes];
|
||||
|
||||
export enum EAuthSteps {
|
||||
EMAIL = "EMAIL",
|
||||
PASSWORD = "PASSWORD",
|
||||
UNIQUE_CODE = "UNIQUE_CODE",
|
||||
}
|
||||
export const EAuthModes = {
|
||||
SIGN_IN: "SIGN_IN",
|
||||
SIGN_UP: "SIGN_UP",
|
||||
} as const;
|
||||
|
||||
export enum EErrorAlertType {
|
||||
BANNER_ALERT = "BANNER_ALERT",
|
||||
INLINE_FIRST_NAME = "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL = "INLINE_EMAIL",
|
||||
INLINE_PASSWORD = "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE = "INLINE_EMAIL_CODE",
|
||||
}
|
||||
export type EAuthModes = typeof EAuthModes[keyof typeof EAuthModes];
|
||||
|
||||
export enum EAuthenticationErrorCodes {
|
||||
export const EAuthSteps = {
|
||||
EMAIL: "EMAIL",
|
||||
PASSWORD: "PASSWORD",
|
||||
UNIQUE_CODE: "UNIQUE_CODE",
|
||||
} as const;
|
||||
|
||||
export type EAuthSteps = typeof EAuthSteps[keyof typeof EAuthSteps];
|
||||
|
||||
export const EErrorAlertType = {
|
||||
BANNER_ALERT: "BANNER_ALERT",
|
||||
INLINE_FIRST_NAME: "INLINE_FIRST_NAME",
|
||||
INLINE_EMAIL: "INLINE_EMAIL",
|
||||
INLINE_PASSWORD: "INLINE_PASSWORD",
|
||||
INLINE_EMAIL_CODE: "INLINE_EMAIL_CODE",
|
||||
} as const;
|
||||
|
||||
export type EErrorAlertType = typeof EErrorAlertType[keyof typeof EErrorAlertType];
|
||||
|
||||
export const EAuthenticationErrorCodes = {
|
||||
// Global
|
||||
INSTANCE_NOT_CONFIGURED = "5000",
|
||||
INVALID_EMAIL = "5005",
|
||||
EMAIL_REQUIRED = "5010",
|
||||
SIGNUP_DISABLED = "5015",
|
||||
MAGIC_LINK_LOGIN_DISABLED = "5016",
|
||||
PASSWORD_LOGIN_DISABLED = "5018",
|
||||
USER_ACCOUNT_DEACTIVATED = "5019",
|
||||
INSTANCE_NOT_CONFIGURED: "5000",
|
||||
INVALID_EMAIL: "5005",
|
||||
EMAIL_REQUIRED: "5010",
|
||||
SIGNUP_DISABLED: "5015",
|
||||
MAGIC_LINK_LOGIN_DISABLED: "5016",
|
||||
PASSWORD_LOGIN_DISABLED: "5018",
|
||||
USER_ACCOUNT_DEACTIVATED: "5019",
|
||||
// Password strength
|
||||
INVALID_PASSWORD = "5020",
|
||||
SMTP_NOT_CONFIGURED = "5025",
|
||||
INVALID_PASSWORD: "5020",
|
||||
SMTP_NOT_CONFIGURED: "5025",
|
||||
// Sign Up
|
||||
USER_ALREADY_EXIST = "5030",
|
||||
AUTHENTICATION_FAILED_SIGN_UP = "5035",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_UP = "5040",
|
||||
INVALID_EMAIL_SIGN_UP = "5045",
|
||||
INVALID_EMAIL_MAGIC_SIGN_UP = "5050",
|
||||
MAGIC_SIGN_UP_EMAIL_CODE_REQUIRED = "5055",
|
||||
USER_ALREADY_EXIST: "5030",
|
||||
AUTHENTICATION_FAILED_SIGN_UP: "5035",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_UP: "5040",
|
||||
INVALID_EMAIL_SIGN_UP: "5045",
|
||||
INVALID_EMAIL_MAGIC_SIGN_UP: "5050",
|
||||
MAGIC_SIGN_UP_EMAIL_CODE_REQUIRED: "5055",
|
||||
// Sign In
|
||||
USER_DOES_NOT_EXIST = "5060",
|
||||
AUTHENTICATION_FAILED_SIGN_IN = "5065",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_IN = "5070",
|
||||
INVALID_EMAIL_SIGN_IN = "5075",
|
||||
INVALID_EMAIL_MAGIC_SIGN_IN = "5080",
|
||||
MAGIC_SIGN_IN_EMAIL_CODE_REQUIRED = "5085",
|
||||
USER_DOES_NOT_EXIST: "5060",
|
||||
AUTHENTICATION_FAILED_SIGN_IN: "5065",
|
||||
REQUIRED_EMAIL_PASSWORD_SIGN_IN: "5070",
|
||||
INVALID_EMAIL_SIGN_IN: "5075",
|
||||
INVALID_EMAIL_MAGIC_SIGN_IN: "5080",
|
||||
MAGIC_SIGN_IN_EMAIL_CODE_REQUIRED: "5085",
|
||||
// Both Sign in and Sign up for magic
|
||||
INVALID_MAGIC_CODE_SIGN_IN = "5090",
|
||||
INVALID_MAGIC_CODE_SIGN_UP = "5092",
|
||||
EXPIRED_MAGIC_CODE_SIGN_IN = "5095",
|
||||
EXPIRED_MAGIC_CODE_SIGN_UP = "5097",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN = "5100",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP = "5102",
|
||||
INVALID_MAGIC_CODE_SIGN_IN: "5090",
|
||||
INVALID_MAGIC_CODE_SIGN_UP: "5092",
|
||||
EXPIRED_MAGIC_CODE_SIGN_IN: "5095",
|
||||
EXPIRED_MAGIC_CODE_SIGN_UP: "5097",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN: "5100",
|
||||
EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP: "5102",
|
||||
// Oauth
|
||||
OAUTH_NOT_CONFIGURED = "5104",
|
||||
GOOGLE_NOT_CONFIGURED = "5105",
|
||||
GITHUB_NOT_CONFIGURED = "5110",
|
||||
GITLAB_NOT_CONFIGURED = "5111",
|
||||
GOOGLE_OAUTH_PROVIDER_ERROR = "5115",
|
||||
GITHUB_OAUTH_PROVIDER_ERROR = "5120",
|
||||
GITLAB_OAUTH_PROVIDER_ERROR = "5121",
|
||||
OAUTH_NOT_CONFIGURED: "5104",
|
||||
GOOGLE_NOT_CONFIGURED: "5105",
|
||||
GITHUB_NOT_CONFIGURED: "5110",
|
||||
GITLAB_NOT_CONFIGURED: "5111",
|
||||
GOOGLE_OAUTH_PROVIDER_ERROR: "5115",
|
||||
GITHUB_OAUTH_PROVIDER_ERROR: "5120",
|
||||
GITLAB_OAUTH_PROVIDER_ERROR: "5121",
|
||||
// Reset Password
|
||||
INVALID_PASSWORD_TOKEN = "5125",
|
||||
EXPIRED_PASSWORD_TOKEN = "5130",
|
||||
INVALID_PASSWORD_TOKEN: "5125",
|
||||
EXPIRED_PASSWORD_TOKEN: "5130",
|
||||
// Change password
|
||||
INCORRECT_OLD_PASSWORD = "5135",
|
||||
MISSING_PASSWORD = "5138",
|
||||
INVALID_NEW_PASSWORD = "5140",
|
||||
// set passowrd
|
||||
PASSWORD_ALREADY_SET = "5145",
|
||||
INCORRECT_OLD_PASSWORD: "5135",
|
||||
MISSING_PASSWORD: "5138",
|
||||
INVALID_NEW_PASSWORD: "5140",
|
||||
// set password
|
||||
PASSWORD_ALREADY_SET: "5145",
|
||||
// Admin
|
||||
ADMIN_ALREADY_EXIST = "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME = "5155",
|
||||
INVALID_ADMIN_EMAIL = "5160",
|
||||
INVALID_ADMIN_PASSWORD = "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD = "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED = "5175",
|
||||
ADMIN_USER_ALREADY_EXIST = "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST = "5185",
|
||||
ADMIN_USER_DEACTIVATED = "5190",
|
||||
ADMIN_ALREADY_EXIST: "5150",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME: "5155",
|
||||
INVALID_ADMIN_EMAIL: "5160",
|
||||
INVALID_ADMIN_PASSWORD: "5165",
|
||||
REQUIRED_ADMIN_EMAIL_PASSWORD: "5170",
|
||||
ADMIN_AUTHENTICATION_FAILED: "5175",
|
||||
ADMIN_USER_ALREADY_EXIST: "5180",
|
||||
ADMIN_USER_DOES_NOT_EXIST: "5185",
|
||||
ADMIN_USER_DEACTIVATED: "5190",
|
||||
// Rate limit
|
||||
RATE_LIMIT_EXCEEDED = "5900",
|
||||
}
|
||||
RATE_LIMIT_EXCEEDED: "5900",
|
||||
} as const;
|
||||
|
||||
export type EAuthenticationErrorCodes = typeof EAuthenticationErrorCodes[keyof typeof EAuthenticationErrorCodes];
|
||||
|
||||
export type TAuthErrorInfo = {
|
||||
type: EErrorAlertType;
|
||||
|
||||
+23
-17
@@ -1,25 +1,31 @@
|
||||
import { subDays } from "date-fns";
|
||||
import { renderFormattedPayloadDate } from "./date-time.helper";
|
||||
|
||||
export enum EInboxIssueCurrentTab {
|
||||
OPEN = "open",
|
||||
CLOSED = "closed",
|
||||
}
|
||||
export const EInboxIssueCurrentTab = {
|
||||
OPEN: "open",
|
||||
CLOSED: "closed",
|
||||
} as const;
|
||||
|
||||
export enum EInboxIssueStatus {
|
||||
PENDING = -2,
|
||||
DECLINED = -1,
|
||||
SNOOZED = 0,
|
||||
ACCEPTED = 1,
|
||||
DUPLICATE = 2,
|
||||
}
|
||||
export type EInboxIssueCurrentTab = typeof EInboxIssueCurrentTab[keyof typeof EInboxIssueCurrentTab];
|
||||
|
||||
export enum EPastDurationFilters {
|
||||
TODAY = "today",
|
||||
YESTERDAY = "yesterday",
|
||||
LAST_7_DAYS = "last_7_days",
|
||||
LAST_30_DAYS = "last_30_days",
|
||||
}
|
||||
export const EInboxIssueStatus = {
|
||||
PENDING: -2,
|
||||
DECLINED: -1,
|
||||
SNOOZED: 0,
|
||||
ACCEPTED: 1,
|
||||
DUPLICATE: 2,
|
||||
} as const;
|
||||
|
||||
export type EInboxIssueStatus = typeof EInboxIssueStatus[keyof typeof EInboxIssueStatus];
|
||||
|
||||
export const EPastDurationFilters = {
|
||||
TODAY: "today",
|
||||
YESTERDAY: "yesterday",
|
||||
LAST_7_DAYS: "last_7_days",
|
||||
LAST_30_DAYS: "last_30_days",
|
||||
} as const;
|
||||
|
||||
export type EPastDurationFilters = typeof EPastDurationFilters[keyof typeof EPastDurationFilters];
|
||||
|
||||
export const getCustomDates = (duration: EPastDurationFilters): string => {
|
||||
const today = new Date();
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import zxcvbn from "zxcvbn";
|
||||
|
||||
export enum E_PASSWORD_STRENGTH {
|
||||
EMPTY = "empty",
|
||||
LENGTH_NOT_VALID = "length_not_valid",
|
||||
STRENGTH_NOT_VALID = "strength_not_valid",
|
||||
STRENGTH_VALID = "strength_valid",
|
||||
}
|
||||
export const E_PASSWORD_STRENGTH = {
|
||||
EMPTY: "empty",
|
||||
LENGTH_NOT_VALID: "length_not_valid",
|
||||
STRENGTH_NOT_VALID: "strength_not_valid",
|
||||
STRENGTH_VALID: "strength_valid",
|
||||
} as const;
|
||||
|
||||
export type E_PASSWORD_STRENGTH = typeof E_PASSWORD_STRENGTH[keyof typeof E_PASSWORD_STRENGTH];
|
||||
|
||||
const PASSWORD_MIN_LENGTH = 8;
|
||||
// const PASSWORD_NUMBER_REGEX = /\d/;
|
||||
|
||||
Reference in New Issue
Block a user