mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
Merge branch 'preview' of github.com:makeplane/plane-ee into uat
This commit is contained in:
@@ -116,9 +116,20 @@ def validate_file(issue_property, value):
|
||||
def save_text(
|
||||
issue_property, values, existing_values, issue_id, project_id, workspace_id
|
||||
):
|
||||
if values:
|
||||
# Case 1 - The property is updated
|
||||
if existing_values and values[0] != existing_values[0]:
|
||||
return [
|
||||
IssuePropertyValue(
|
||||
property=issue_property,
|
||||
value_text=values[0],
|
||||
issue_id=issue_id,
|
||||
project_id=project_id,
|
||||
workspace_id=workspace_id,
|
||||
)
|
||||
]
|
||||
|
||||
# Case 1 - The property is updated
|
||||
if existing_values and values[0] != existing_values[0]:
|
||||
# Case 2 - The property is created
|
||||
return [
|
||||
IssuePropertyValue(
|
||||
property=issue_property,
|
||||
@@ -126,19 +137,11 @@ def save_text(
|
||||
issue_id=issue_id,
|
||||
project_id=project_id,
|
||||
workspace_id=workspace_id,
|
||||
)
|
||||
),
|
||||
]
|
||||
|
||||
# Case 2 - The property is created
|
||||
return [
|
||||
IssuePropertyValue(
|
||||
property=issue_property,
|
||||
value_text=values[0],
|
||||
issue_id=issue_id,
|
||||
project_id=project_id,
|
||||
workspace_id=workspace_id,
|
||||
),
|
||||
]
|
||||
else:
|
||||
# Case 3 - The property is deleted
|
||||
return []
|
||||
|
||||
|
||||
def save_datetime(
|
||||
|
||||
@@ -348,7 +348,7 @@ SESSION_COOKIE_SECURE = secure_origins
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
SESSION_ENGINE = "plane.db.models.session"
|
||||
SESSION_COOKIE_AGE = os.environ.get("SESSION_COOKIE_AGE", 604800)
|
||||
SESSION_COOKIE_NAME = "plane-session-id"
|
||||
SESSION_COOKIE_NAME = os.environ.get("SESSION_COOKIE_NAME", "session-id")
|
||||
SESSION_COOKIE_DOMAIN = os.environ.get("COOKIE_DOMAIN", None)
|
||||
SESSION_SAVE_EVERY_REQUEST = (
|
||||
os.environ.get("SESSION_SAVE_EVERY_REQUEST", "0") == "1"
|
||||
@@ -363,7 +363,7 @@ else:
|
||||
|
||||
|
||||
# Admin Cookie
|
||||
ADMIN_SESSION_COOKIE_NAME = "plane-admin-session-id"
|
||||
ADMIN_SESSION_COOKIE_NAME = "admin-session-id"
|
||||
ADMIN_SESSION_COOKIE_AGE = os.environ.get("ADMIN_SESSION_COOKIE_AGE", 3600)
|
||||
|
||||
# CSRF cookies
|
||||
|
||||
@@ -43,8 +43,5 @@
|
||||
"resolutions": {
|
||||
"@types/react": "18.2.48"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
}
|
||||
|
||||
@@ -97,17 +97,17 @@ export const AccountTypeColumn: React.FC<AccountTypeProps> = observer((props) =>
|
||||
|
||||
// derived values
|
||||
const isCurrentUser = currentUser?.id === rowData.member.id;
|
||||
const isAdminRole = currentProjectRole === EUserPermissions.ADMIN;
|
||||
const isRoleNonEditable = isCurrentUser || !isAdminRole;
|
||||
const isAdminOrGuest = [EUserPermissions.ADMIN, EUserPermissions.GUEST].includes(rowData.role);
|
||||
const isRoleNonEditable = isCurrentUser || isAdminOrGuest;
|
||||
|
||||
const checkCurrentOptionWorkspaceRole = (value: string) => {
|
||||
const currentMemberWorkspaceRole = getWorkspaceMemberDetails(value)?.role as EUserPermissions | undefined;
|
||||
if (!value || !currentMemberWorkspaceRole) return ROLE;
|
||||
|
||||
const isGuestOrViewer = [EUserPermissions.GUEST].includes(currentMemberWorkspaceRole);
|
||||
const isGuestOROwner = [EUserPermissions.ADMIN, EUserPermissions.GUEST].includes(currentMemberWorkspaceRole);
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries(ROLE).filter(([key]) => !isGuestOrViewer || [5, 10].includes(parseInt(key)))
|
||||
Object.entries(ROLE).filter(([key]) => !isGuestOROwner || [currentMemberWorkspaceRole].includes(parseInt(key)))
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user