Merge branch 'develop' into feature/socket-newtag
This commit is contained in:
commit
1b7844b44a
@ -74,14 +74,10 @@ services_name_backend+=(ASC.Data.Backup)
|
||||
services_name_backend+=(ASC.Files.Service)
|
||||
services_name_backend+=(ASC.Notify)
|
||||
services_name_backend+=(ASC.Studio.Notify)
|
||||
services_name_backend+=(ASC.TelegramService)
|
||||
services_name_backend+=(ASC.UrlShortener.Svc)
|
||||
services_name_backend+=(ASC.Web.Api)
|
||||
services_name_backend+=(ASC.Web.Studio)
|
||||
services_name_backend+=(ASC.Data.Backup.BackgroundTasks)
|
||||
services_name_backend+=(ASC.ClearEvents)
|
||||
services_name_backend+=(ASC.Migration)
|
||||
services_name_backend+=(ASC.Webhooks.Service)
|
||||
services_name_backend+=(ASC.ApiSystem)
|
||||
|
||||
# Publish backend services
|
||||
@ -94,7 +90,6 @@ done
|
||||
|
||||
# Array of names backend services in directory common (Nodejs)
|
||||
services_name_backend_nodejs=()
|
||||
services_name_backend_nodejs+=(ASC.UrlShortener)
|
||||
services_name_backend_nodejs+=(ASC.Socket.IO)
|
||||
services_name_backend_nodejs+=(ASC.SsoAuth)
|
||||
|
||||
|
@ -54,9 +54,6 @@
|
||||
BACKUP_HOST=${CONTAINER_PREFIX}backup
|
||||
BACKUP_BACKGRUOND_TASKS_HOST=${CONTAINER_PREFIX}backup-background-tasks
|
||||
CLEAR_EVENTS_HOST=${CONTAINER_PREFIX}clear-events
|
||||
MIGRATION_HOST=${CONTAINER_PREFIX}migration
|
||||
WEBHOOKS_SERVICE_HOST=${CONTAINER_PREFIX}webhooks-service
|
||||
STORAGE_ENCRYPTION_HOST=${CONTAINER_PREFIX}storage-encryption
|
||||
FILES_HOST=${CONTAINER_PREFIX}files
|
||||
FILES_SERVICES_HOST=${CONTAINER_PREFIX}files-services
|
||||
STORAGE_MIGRATION_HOST=${CONTAINER_PREFIX}storage-migration
|
||||
@ -64,8 +61,6 @@
|
||||
PEOPLE_SERVER_HOST=${CONTAINER_PREFIX}people-server
|
||||
SOCKET_HOST=${CONTAINER_PREFIX}socket
|
||||
STUDIO_NOTIFY_HOST=${CONTAINER_PREFIX}studio-notify
|
||||
TELEGRAM_SERVICE_HOST=${CONTAINER_PREFIX}telegram-service
|
||||
URLSHORTENER_HOST=${CONTAINER_PREFIX}urlshortener
|
||||
API_HOST=${CONTAINER_PREFIX}api
|
||||
STUDIO_HOST=${CONTAINER_PREFIX}studio
|
||||
SSOAUTH_HOST=${CONTAINER_PREFIX}ssoauth
|
||||
@ -79,9 +74,6 @@
|
||||
SERVICE_BACKUP=${BACKUP_HOST}:${SERVICE_PORT}
|
||||
SERVICE_BACKUP_BACKGRUOND_TASKS=${BACKUP_BACKGRUOND_TASKS_HOST}:${SERVICE_PORT}
|
||||
SERVICE_CLEAR_EVENTS=${CLEAR_EVENTS_HOST}:${SERVICE_PORT}
|
||||
SERVICE_MIGRATION=${MIGRATION_HOST}:${SERVICE_PORT}
|
||||
SERVICE_WEBHOOKS_SERVICE=${WEBHOOKS_SERVICE_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STORAGE_ENCRYPTION=${STORAGE_ENCRYPTION_HOST}:${SERVICE_PORT}
|
||||
SERVICE_FILES=${FILES_HOST}:${SERVICE_PORT}
|
||||
SERVICE_FILES_SERVICES=${FILES_SERVICES_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STORAGE_MIGRATION=${STORAGE_MIGRATION_HOST}:${SERVICE_PORT}
|
||||
@ -89,8 +81,6 @@
|
||||
SERVICE_PEOPLE_SERVER=${PEOPLE_SERVER_HOST}:${SERVICE_PORT}
|
||||
SERVICE_SOCKET=${SOCKET_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STUDIO_NOTIFY=${STUDIO_NOTIFY_HOST}:${SERVICE_PORT}
|
||||
SERVICE_TELEGRAM_SERVICE=${TELEGRAM_SERVICE_HOST}:${SERVICE_PORT}
|
||||
SERVICE_URLSHORTENER=${URLSHORTENER_HOST}:${SERVICE_PORT}
|
||||
SERVICE_API=${API_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STUDIO=${STUDIO_HOST}:${SERVICE_PORT}
|
||||
SERVICE_SSOAUTH=${SSOAUTH_HOST}:${SERVICE_PORT}
|
||||
|
@ -150,18 +150,12 @@ RUN chown nginx:nginx /etc/nginx/* -R && \
|
||||
# changes for upstream configure
|
||||
sed -i 's/127.0.0.1:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5012/$service_backup/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5021/$service_crm/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5007/$service_files/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5004/$service_people_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5020/$service_projects_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5000/$service_api/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5003/$service_studio/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5023/$service_calendar/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:9899/$service_socket/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:9834/$service_sso/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5022/$service_mail/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:9999/$service_urlshortener/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5034/$service_migration/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5013/$service_doceditor/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5011/$service_login/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/$public_root/\/var\/www\/public\//' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
@ -212,15 +206,6 @@ COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.ClearE
|
||||
|
||||
CMD ["ASC.ClearEvents.dll", "ASC.ClearEvents"]
|
||||
|
||||
## ASC.Migration ##
|
||||
FROM dotnetrun AS migration
|
||||
WORKDIR ${BUILD_PATH}/services/ASC.Migration/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.py ./docker-entrypoint.py
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Migration/service/ .
|
||||
|
||||
CMD ["ASC.Migration.dll", "ASC.Migration"]
|
||||
|
||||
## ASC.Data.Backup ##
|
||||
FROM dotnetrun AS backup
|
||||
WORKDIR ${BUILD_PATH}/services/ASC.Data.Backup/
|
||||
@ -293,24 +278,6 @@ COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Studio
|
||||
|
||||
CMD ["ASC.Studio.Notify.dll", "ASC.Studio.Notify"]
|
||||
|
||||
## ASC.TelegramService ##
|
||||
FROM dotnetrun AS telegram_service
|
||||
WORKDIR ${BUILD_PATH}/services/ASC.TelegramService/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.py ./docker-entrypoint.py
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.TelegramService/service/ .
|
||||
|
||||
CMD ["ASC.TelegramService.dll", "ASC.TelegramService"]
|
||||
|
||||
## ASC.UrlShortener ##
|
||||
FROM noderun AS urlshortener
|
||||
WORKDIR ${BUILD_PATH}/services/ASC.UrlShortener/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.py ./docker-entrypoint.py
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.UrlShortener/service/ .
|
||||
|
||||
CMD ["index.js", "ASC.UrlShortener"]
|
||||
|
||||
## ASC.Web.Api ##
|
||||
FROM dotnetrun AS api
|
||||
WORKDIR ${BUILD_PATH}/studio/ASC.Web.Api/
|
||||
@ -320,15 +287,6 @@ COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Web.Ap
|
||||
|
||||
CMD ["ASC.Web.Api.dll", "ASC.Web.Api"]
|
||||
|
||||
## ASC.Webhooks.Service ##
|
||||
FROM dotnetrun AS webhooks-service
|
||||
WORKDIR ${BUILD_PATH}/services/ASC.Webhooks.Service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.py ./docker-entrypoint.py
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Webhooks.Service/service/ .
|
||||
|
||||
CMD ["ASC.Webhooks.Service.dll", "ASC.Webhooks.Service"]
|
||||
|
||||
## ASC.Web.Studio ##
|
||||
FROM dotnetrun AS studio
|
||||
WORKDIR ${BUILD_PATH}/studio/ASC.Web.Studio/
|
||||
|
@ -150,7 +150,7 @@ RUN dos2unix /docker-entrypoint.d/prepare-nginx-proxy.sh && \
|
||||
RUN chown nginx:nginx /etc/nginx/* -R && \
|
||||
chown nginx:nginx /docker-entrypoint.d/* && \
|
||||
# changes for upstream configure
|
||||
sed -i 's/127.0.0.1:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
# sed -i 's/127.0.0.1:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5012/$service_backup/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5007/$service_files/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5004/$service_people_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
@ -158,8 +158,8 @@ RUN chown nginx:nginx /etc/nginx/* -R && \
|
||||
sed -i 's/127.0.0.1:5003/$service_studio/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:9899/$service_socket/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:9834/$service_sso/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:9999/$service_urlshortener/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5034/$service_migration/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
# sed -i 's/127.0.0.1:9999/$service_urlshortener/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
# sed -i 's/127.0.0.1:5034/$service_migration/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5013/$service_doceditor/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5011/$service_login/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/127.0.0.1:5001/$service_client/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
|
@ -63,11 +63,6 @@ services:
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-clear-events:${DOCKER_TAG}"
|
||||
container_name: ${CLEAR_EVENTS_HOST}
|
||||
|
||||
onlyoffice-migration:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-migration:${DOCKER_TAG}"
|
||||
container_name: ${MIGRATION_HOST}
|
||||
|
||||
onlyoffice-files:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-files:${DOCKER_TAG}"
|
||||
@ -95,19 +90,6 @@ services:
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-studio-notify:${DOCKER_TAG}"
|
||||
container_name: ${STUDIO_NOTIFY_HOST}
|
||||
|
||||
onlyoffice-telegram-service:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-telegram-service:${DOCKER_TAG}"
|
||||
container_name: ${TELEGRAM_SERVICE_HOST}
|
||||
|
||||
onlyoffice-urlshortener:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-urlshortener:${DOCKER_TAG}"
|
||||
container_name: ${URLSHORTENER_HOST}
|
||||
expose:
|
||||
- ${SERVICE_PORT}
|
||||
- "9999"
|
||||
|
||||
onlyoffice-api:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-api:${DOCKER_TAG}"
|
||||
@ -131,11 +113,6 @@ services:
|
||||
- ${SERVICE_PORT}
|
||||
- "9834"
|
||||
|
||||
onlyoffice-webhooks-service:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-webhooks-service:${DOCKER_TAG}"
|
||||
container_name: ${WEBHOOKS_SERVICE_HOST}
|
||||
|
||||
onlyoffice-doceditor:
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-doceditor:${DOCKER_TAG}"
|
||||
container_name: ${DOCEDITOR_HOST}
|
||||
@ -164,15 +141,11 @@ services:
|
||||
- onlyoffice-backup-background-tasks
|
||||
- onlyoffice-backup
|
||||
- onlyoffice-clear-events
|
||||
- onlyoffice-migration
|
||||
- onlyoffice-webhooks-service
|
||||
- onlyoffice-files
|
||||
- onlyoffice-files-services
|
||||
- onlyoffice-people-server
|
||||
- onlyoffice-socket
|
||||
- onlyoffice-studio-notify
|
||||
- onlyoffice-telegram-service
|
||||
- onlyoffice-urlshortener
|
||||
- onlyoffice-api
|
||||
- onlyoffice-api-system
|
||||
- onlyoffice-studio
|
||||
@ -184,14 +157,10 @@ services:
|
||||
- SERVICE_FILES=${SERVICE_FILES}
|
||||
- SERVICE_FILES_SERVICES=${SERVICE_FILES_SERVICES}
|
||||
- SERVICE_CLEAR_EVENTS=${SERVICE_CLEAR_EVENTS}
|
||||
- SERVICE_MIGRATION=${SERVICE_MIGRATION}
|
||||
- SERVICE_WEBHOOKS_SERVICE=${SERVICE_WEBHOOKS_SERVICE}
|
||||
- SERVICE_NOTIFY=${SERVICE_NOTIFY}
|
||||
- SERVICE_PEOPLE_SERVER=${SERVICE_PEOPLE_SERVER}
|
||||
- SERVICE_SOCKET=${SERVICE_SOCKET}
|
||||
- SERVICE_STUDIO_NOTIFY=${SERVICE_STUDIO_NOTIFY}
|
||||
- SERVICE_TELEGRAM_SERVICE=${SERVICE_TELEGRAM_SERVICE}
|
||||
- SERVICE_URLSHORTENER=${SERVICE_URLSHORTENER}
|
||||
- SERVICE_API=${SERVICE_API}
|
||||
- SERVICE_API_SYSTEM=${SERVICE_API_SYSTEM}
|
||||
- SERVICE_STUDIO=${SERVICE_STUDIO}
|
||||
|
@ -15,13 +15,6 @@ services:
|
||||
target: clear-events
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-clear-events:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-migration:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: migration
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-migration:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-backup:
|
||||
build:
|
||||
context: ./
|
||||
@ -71,20 +64,6 @@ services:
|
||||
target: studio_notify
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-studio-notify:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-telegram-service:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: telegram_service
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-telegram-service:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-urlshortener:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: urlshortener
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-urlshortener:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-api:
|
||||
build:
|
||||
context: ./
|
||||
@ -113,13 +92,6 @@ services:
|
||||
target: ssoauth
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-ssoauth:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-webhooks-service:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: webhooks-service
|
||||
image: "${REPO}/${DOCKER_IMAGE_PREFIX}-webhooks-service:${DOCKER_TAG}"
|
||||
|
||||
onlyoffice-bin-share:
|
||||
build:
|
||||
context: ./
|
||||
|
@ -15,11 +15,6 @@ map $SERVICE_CLIENT $service_client {
|
||||
$SERVICE_CLIENT $SERVICE_CLIENT;
|
||||
}
|
||||
|
||||
map $SERVICE_MIGRATION $service_migration {
|
||||
volatile;
|
||||
$SERVICE_MIGRATION $SERVICE_MIGRATION;
|
||||
}
|
||||
|
||||
map $SERVICE_API_SYSTEM $service_api_system {
|
||||
volatile;
|
||||
$SERVICE_API_SYSTEM $SERVICE_API_SYSTEM;
|
||||
@ -30,21 +25,6 @@ map $SERVICE_BACKUP $service_backup {
|
||||
$SERVICE_BACKUP $SERVICE_BACKUP;
|
||||
}
|
||||
|
||||
map $SERVICE_CALENDAR $service_calendar {
|
||||
volatile;
|
||||
$SERVICE_CALENDAR $SERVICE_CALENDAR;
|
||||
}
|
||||
|
||||
map $SERVICE_CRM $service_crm {
|
||||
volatile;
|
||||
$SERVICE_CRM $SERVICE_CRM;
|
||||
}
|
||||
|
||||
map $SERVICE_STORAGE_ENCRYPTION $service_storage_encryption {
|
||||
volatile;
|
||||
$SERVICE_STORAGE_ENCRYPTION $SERVICE_STORAGE_ENCRYPTION;
|
||||
}
|
||||
|
||||
map $SERVICE_FILES $service_files {
|
||||
volatile;
|
||||
$SERVICE_FILES $SERVICE_FILES;
|
||||
@ -55,16 +35,6 @@ map $SERVICE_FILES_SERVICES $service_files_services {
|
||||
$SERVICE_FILES_SERVICES $SERVICE_FILES_SERVICES;
|
||||
}
|
||||
|
||||
map $SERVICE_MAIL $service_mail {
|
||||
volatile;
|
||||
$SERVICE_MAIL $SERVICE_MAIL;
|
||||
}
|
||||
|
||||
map $SERVICE_STORAGE_MIGRATION $service_storage_migration {
|
||||
volatile;
|
||||
$SERVICE_STORAGE_MIGRATION $SERVICE_STORAGE_MIGRATION;
|
||||
}
|
||||
|
||||
map $SERVICE_NOTIFY $service_notify {
|
||||
volatile;
|
||||
$SERVICE_NOTIFY $SERVICE_NOTIFY;
|
||||
@ -75,11 +45,6 @@ map $SERVICE_PEOPLE_SERVER $service_people_server {
|
||||
$SERVICE_PEOPLE_SERVER $SERVICE_PEOPLE_SERVER;
|
||||
}
|
||||
|
||||
map $SERVICE_PROJECTS_SERVER $service_projects_server {
|
||||
volatile;
|
||||
$SERVICE_PROJECTS_SERVER $SERVICE_PROJECTS_SERVER;
|
||||
}
|
||||
|
||||
map $SERVICE_SOCKET $service_socket {
|
||||
volatile;
|
||||
$SERVICE_SOCKET $SERVICE_SOCKET;
|
||||
@ -90,21 +55,11 @@ map $SERVICE_STUDIO_NOTIFY $service_studio_notify {
|
||||
$SERVICE_STUDIO_NOTIFY $SERVICE_STUDIO_NOTIFY;
|
||||
}
|
||||
|
||||
map $SERVICE_TELEGRAM_SERVICE $service_telegram_service {
|
||||
volatile;
|
||||
$SERVICE_TELEGRAM_SERVICE $SERVICE_TELEGRAM_SERVICE;
|
||||
}
|
||||
|
||||
map $SERVICE_THUMBNAILS $service_thumbnails {
|
||||
volatile;
|
||||
$SERVICE_THUMBNAILS $SERVICE_THUMBNAILS;
|
||||
}
|
||||
|
||||
map $SERVICE_URLSHORTENER $service_urlshortener {
|
||||
volatile;
|
||||
$SERVICE_URLSHORTENER $SERVICE_URLSHORTENER;
|
||||
}
|
||||
|
||||
map $SERVICE_API $service_api {
|
||||
volatile;
|
||||
$SERVICE_API $SERVICE_API;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@ MYSQL_HOST = os.environ["MYSQL_HOST"] if environ.get("MYSQL_HOST") else "localho
|
||||
MYSQL_DATABASE = os.environ["MYSQL_DATABASE"] if environ.get("MYSQL_DATABASE") else "onlyoffice"
|
||||
MYSQL_USER = os.environ["MYSQL_USER"] if environ.get("MYSQL_USER") else "onlyoffice_user"
|
||||
MYSQL_PASSWORD = os.environ["MYSQL_PASSWORD"] if environ.get("MYSQL_PASSWORD") else "onlyoffice_pass"
|
||||
DATABASE_MIGRATION = os.environ["DATABASE_MIGRATION"] if environ.get("DATABASE_MIGRATION") else "false"
|
||||
|
||||
APP_CORE_BASE_DOMAIN = os.environ["APP_CORE_BASE_DOMAIN"] if environ.get("APP_CORE_BASE_DOMAIN") is not None else "localhost"
|
||||
APP_CORE_MACHINEKEY = os.environ["APP_CORE_MACHINEKEY"] if environ.get("APP_CORE_MACHINEKEY") else "your_core_machinekey"
|
||||
@ -128,13 +127,11 @@ updateJsonData(jsonData,"$.core.base-domain", APP_CORE_BASE_DOMAIN)
|
||||
updateJsonData(jsonData,"$.core.machinekey", APP_CORE_MACHINEKEY)
|
||||
updateJsonData(jsonData,"$.core.products.subfolder", "server")
|
||||
updateJsonData(jsonData,"$.web.hub.internal", "http://onlyoffice-socket:" + SERVICE_PORT + "/")
|
||||
updateJsonData(jsonData,"$.web.url-shortener.internal", "http://onlyoffice-urlshortener:" + SERVICE_PORT + "/")
|
||||
updateJsonData(jsonData,"$.files.docservice.url.portal", APP_URL_PORTAL)
|
||||
updateJsonData(jsonData,"$.files.docservice.url.public", DOCUMENT_SERVER_URL_PUBLIC)
|
||||
updateJsonData(jsonData,"$.files.docservice.url.internal", DOCUMENT_SERVER_URL_INTERNAL)
|
||||
updateJsonData(jsonData,"$.files.docservice.secret.value", DOCUMENT_SERVER_JWT_SECRET)
|
||||
updateJsonData(jsonData,"$.files.docservice.secret.header", DOCUMENT_SERVER_JWT_HEADER)
|
||||
updateJsonData(jsonData,"$.migration.enabled", DATABASE_MIGRATION)
|
||||
writeJsonFile(filePath, jsonData)
|
||||
|
||||
filePath = "/app/onlyoffice/config/elastic.json"
|
||||
|
@ -173,14 +173,14 @@ services:
|
||||
- SERVICE_CLEAR_EVENTS=${SERVICE_CLEAR_EVENTS}
|
||||
# - SERVICE_MIGRATION=${SERVICE_MIGRATION}
|
||||
# - SERVICE_WEBHOOKS_SERVICE=${SERVICE_WEBHOOKS_SERVICE}
|
||||
# - SERVICE_NOTIFY=${SERVICE_NOTIFY}
|
||||
- SERVICE_NOTIFY=${SERVICE_NOTIFY}
|
||||
- SERVICE_PEOPLE_SERVER=${SERVICE_PEOPLE_SERVER}
|
||||
- SERVICE_SOCKET=${SERVICE_SOCKET}
|
||||
- SERVICE_STUDIO_NOTIFY=${SERVICE_STUDIO_NOTIFY}
|
||||
# - SERVICE_TELEGRAM_SERVICE=${SERVICE_TELEGRAM_SERVICE}
|
||||
# - SERVICE_URLSHORTENER=${SERVICE_URLSHORTENER}
|
||||
- SERVICE_API=${SERVICE_API}
|
||||
# - SERVICE_API_SYSTEM=${SERVICE_API_SYSTEM}
|
||||
- SERVICE_API_SYSTEM=${SERVICE_API_SYSTEM}
|
||||
- SERVICE_STUDIO=${SERVICE_STUDIO}
|
||||
- SERVICE_SSOAUTH=${SERVICE_SSOAUTH}
|
||||
- SERVICE_DOCEDITOR=${SERVICE_DOCEDITOR}
|
||||
|
@ -17,7 +17,7 @@ if (-not $BranchExistRemote) {
|
||||
$RootDir = Split-Path (Split-Path -Parent $PSScriptRoot) -Parent
|
||||
$DockerDir = ($RootDir + "\build\install\docker")
|
||||
$BuildDate = Get-Date -Format "yyyy-MM-dd"
|
||||
$LocalIp = (Get-WmiObject -Class Win32_NetworkAdapterConfiguration | Where-Object { $_.DHCPEnabled -ne $null -and $_.DefaultIPGateway -ne $null }).IPAddress | Select-Object -First 1
|
||||
$LocalIp = (Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Where-Object { $_.DHCPEnabled -ne $null -and $_.DefaultIPGateway -ne $null }).IPAddress | Select-Object -First 1
|
||||
|
||||
$Doceditor = ($LocalIp + ":5013")
|
||||
$Login = ($LocalIp + ":5011")
|
||||
|
@ -63,10 +63,6 @@ public static class ISetupBuilderExtension
|
||||
|
||||
if (!string.IsNullOrEmpty(awsAccessKeyId))
|
||||
{
|
||||
|
||||
awsTarget.LogGroup = String.IsNullOrEmpty(configuration["aws:cloudWatch:logGroupName"]) ? awsTarget.LogGroup : configuration["aws:cloudWatch:logGroupName"];
|
||||
awsTarget.Region = String.IsNullOrEmpty(configuration["aws:cloudWatch:region"]) ? awsTarget.Region : configuration["aws:cloudWatch:region"];
|
||||
|
||||
awsTarget.Credentials = new Amazon.Runtime.BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey);
|
||||
}
|
||||
}
|
||||
|
@ -185,10 +185,18 @@ public class DIHelper
|
||||
|
||||
public bool TryAdd(Type service, Type implementation = null)
|
||||
{
|
||||
if (service.IsInterface && service.IsGenericType && implementation == null &&
|
||||
(service.GetGenericTypeDefinition() == typeof(IOptionsSnapshot<>) ||
|
||||
service.GetGenericTypeDefinition() == typeof(IOptions<>) ||
|
||||
service.GetGenericTypeDefinition() == typeof(IOptionsMonitor<>)
|
||||
Type serviceGenericTypeDefinition = null;
|
||||
|
||||
if (service.IsGenericType)
|
||||
{
|
||||
serviceGenericTypeDefinition = service.GetGenericTypeDefinition();
|
||||
}
|
||||
|
||||
if (service.IsInterface && serviceGenericTypeDefinition != null && implementation == null &&
|
||||
(
|
||||
serviceGenericTypeDefinition == typeof(IOptionsSnapshot<>) ||
|
||||
serviceGenericTypeDefinition == typeof(IOptions<>) ||
|
||||
serviceGenericTypeDefinition == typeof(IOptionsMonitor<>)
|
||||
))
|
||||
{
|
||||
service = service.GetGenericArguments().FirstOrDefault();
|
||||
@ -208,10 +216,10 @@ public class DIHelper
|
||||
|
||||
Added.Add(serviceName);
|
||||
|
||||
var di = service.IsGenericType && (
|
||||
service.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) ||
|
||||
service.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>) ||
|
||||
service.GetGenericTypeDefinition() == typeof(IOptionsMonitor<>)
|
||||
var di = serviceGenericTypeDefinition != null && (
|
||||
serviceGenericTypeDefinition == typeof(IConfigureOptions<>) ||
|
||||
serviceGenericTypeDefinition == typeof(IPostConfigureOptions<>) ||
|
||||
serviceGenericTypeDefinition == typeof(IOptionsMonitor<>)
|
||||
) && implementation != null ? implementation.GetCustomAttribute<DIAttribute>() : service.GetCustomAttribute<DIAttribute>();
|
||||
|
||||
var isnew = false;
|
||||
@ -237,11 +245,21 @@ public class DIHelper
|
||||
{
|
||||
if (di.Service != null)
|
||||
{
|
||||
var a = di.Service.GetInterfaces().FirstOrDefault(x => x.IsGenericType && (
|
||||
x.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) ||
|
||||
x.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>) ||
|
||||
x.GetGenericTypeDefinition() == typeof(IOptionsMonitor<>)
|
||||
));
|
||||
var a = di.Service.GetInterfaces().FirstOrDefault(x =>
|
||||
{
|
||||
Type xGenericTypeDefinition = null;
|
||||
|
||||
if (x.IsGenericType)
|
||||
{
|
||||
xGenericTypeDefinition = x.GetGenericTypeDefinition();
|
||||
}
|
||||
|
||||
return
|
||||
xGenericTypeDefinition != null && (
|
||||
xGenericTypeDefinition == typeof(IConfigureOptions<>) ||
|
||||
xGenericTypeDefinition == typeof(IPostConfigureOptions<>) ||
|
||||
xGenericTypeDefinition == typeof(IOptionsMonitor<>));
|
||||
});
|
||||
|
||||
if (a != null)
|
||||
{
|
||||
@ -302,11 +320,24 @@ public class DIHelper
|
||||
|
||||
if (di.Implementation != null)
|
||||
{
|
||||
var a = di.Implementation.GetInterfaces().FirstOrDefault(x => x.IsGenericType &&
|
||||
(x.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) ||
|
||||
x.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>) ||
|
||||
x.GetGenericTypeDefinition() == typeof(IOptionsMonitor<>))
|
||||
);
|
||||
var a = di.Implementation.GetInterfaces().FirstOrDefault(x =>
|
||||
{
|
||||
|
||||
Type xGenericTypeDefinition = null;
|
||||
|
||||
if (x.IsGenericType)
|
||||
{
|
||||
xGenericTypeDefinition = x.GetGenericTypeDefinition();
|
||||
}
|
||||
|
||||
return
|
||||
xGenericTypeDefinition != null &&
|
||||
(
|
||||
xGenericTypeDefinition == typeof(IConfigureOptions<>) ||
|
||||
xGenericTypeDefinition == typeof(IPostConfigureOptions<>) ||
|
||||
xGenericTypeDefinition == typeof(IOptionsMonitor<>));
|
||||
});
|
||||
|
||||
if (a != null)
|
||||
{
|
||||
if (!a.ContainsGenericParameters)
|
||||
@ -449,10 +480,17 @@ public class DIHelper
|
||||
return true;
|
||||
}
|
||||
|
||||
var c = service.IsGenericType && (
|
||||
service.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) ||
|
||||
service.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>) ||
|
||||
service.GetGenericTypeDefinition() == typeof(IOptionsMonitor<>)
|
||||
Type serviceGenericTypeDefinition = null;
|
||||
|
||||
if (service.IsGenericType)
|
||||
{
|
||||
serviceGenericTypeDefinition = service.GetGenericTypeDefinition();
|
||||
}
|
||||
|
||||
var c = serviceGenericTypeDefinition != null && (
|
||||
serviceGenericTypeDefinition == typeof(IConfigureOptions<>) ||
|
||||
serviceGenericTypeDefinition == typeof(IPostConfigureOptions<>) ||
|
||||
serviceGenericTypeDefinition == typeof(IOptionsMonitor<>)
|
||||
) && implementation != null ? implementation.GetCustomAttribute<DIAttribute>() : service.GetCustomAttribute<DIAttribute>();
|
||||
|
||||
var serviceName = $"{service}{implementation}";
|
||||
|
@ -114,10 +114,6 @@
|
||||
"internal": "http://localhost:9899/"
|
||||
},
|
||||
"cultures": "az,cs,el-GR,es,fr,ja-JP,lo-LA,nl,pt,ro,sk,tr,vi,bg,de,en-US,en-GB,fi,it,ko-KR,lv,pl,pt-BR,ru,sl,uk-UA,zh-CN",
|
||||
"url-shortener": {
|
||||
"value": "/sh/",
|
||||
"internal": "http://localhost:9999/"
|
||||
},
|
||||
"controlpanel": {
|
||||
"url": ""
|
||||
},
|
||||
|
@ -29,7 +29,7 @@ export default function withBadges(WrappedComponent) {
|
||||
isTrashFolder,
|
||||
} = this.props;
|
||||
if (isTrashFolder) return;
|
||||
fetchFileVersions(item.id + "");
|
||||
fetchFileVersions(item.id + "", item.access);
|
||||
setIsVerHistoryPanel(true);
|
||||
};
|
||||
|
||||
@ -91,6 +91,7 @@ export default function withBadges(WrappedComponent) {
|
||||
isDesktopClient,
|
||||
sectionWidth,
|
||||
viewAs,
|
||||
canViewVersionFileHistory,
|
||||
} = this.props;
|
||||
const { fileStatus, access } = item;
|
||||
|
||||
@ -123,6 +124,7 @@ export default function withBadges(WrappedComponent) {
|
||||
setConvertDialogVisible={this.setConvertDialogVisible}
|
||||
onFilesClick={onFilesClick}
|
||||
viewAs={viewAs}
|
||||
canViewVersionFileHistory={canViewVersionFileHistory}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -142,6 +144,7 @@ export default function withBadges(WrappedComponent) {
|
||||
dialogsStore,
|
||||
filesStore,
|
||||
settingsStore,
|
||||
accessRightsStore,
|
||||
},
|
||||
{ item }
|
||||
) => {
|
||||
@ -158,6 +161,9 @@ export default function withBadges(WrappedComponent) {
|
||||
|
||||
const canWebEdit = settingsStore.canWebEdit(item.fileExst);
|
||||
const canConvert = settingsStore.canConvert(item.fileExst);
|
||||
const canViewVersionFileHistory = accessRightsStore.canViewVersionFileHistory(
|
||||
item
|
||||
);
|
||||
|
||||
return {
|
||||
theme,
|
||||
@ -177,6 +183,7 @@ export default function withBadges(WrappedComponent) {
|
||||
setConvertItem,
|
||||
isDesktopClient,
|
||||
setPinAction,
|
||||
canViewVersionFileHistory,
|
||||
};
|
||||
}
|
||||
)(observer(WithBadges));
|
||||
|
@ -1,7 +1,5 @@
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
|
||||
import { ShareAccessRights } from "@docspace/common/constants";
|
||||
import toastr from "@docspace/components/toast/toastr";
|
||||
import QuickButtons from "../components/QuickButtons";
|
||||
|
||||
@ -56,19 +54,12 @@ export default function withQuickButtons(WrappedComponent) {
|
||||
t,
|
||||
theme,
|
||||
item,
|
||||
isTrashFolder,
|
||||
isAdmin,
|
||||
sectionWidth,
|
||||
viewAs,
|
||||
isArchiveFolderRoot,
|
||||
canLockFile,
|
||||
} = this.props;
|
||||
|
||||
const { access, id, fileExst } = item;
|
||||
|
||||
const accessToEdit =
|
||||
access === ShareAccessRights.FullAccess ||
|
||||
access === ShareAccessRights.None; // TODO: fix access type for owner (now - None)
|
||||
|
||||
const quickButtonsComponent = (
|
||||
<QuickButtons
|
||||
t={t}
|
||||
@ -76,14 +67,12 @@ export default function withQuickButtons(WrappedComponent) {
|
||||
item={item}
|
||||
sectionWidth={sectionWidth}
|
||||
isAdmin={isAdmin}
|
||||
isTrashFolder={isTrashFolder}
|
||||
accessToEdit={accessToEdit}
|
||||
viewAs={viewAs}
|
||||
isDisabled={isLoading}
|
||||
isCanWebEdit={isCanWebEdit}
|
||||
onClickLock={this.onClickLock}
|
||||
onClickFavorite={this.onClickFavorite}
|
||||
isArchiveFolderRoot={isArchiveFolderRoot}
|
||||
canLockFile={canLockFile}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -99,13 +88,11 @@ export default function withQuickButtons(WrappedComponent) {
|
||||
return inject(
|
||||
({
|
||||
auth,
|
||||
treeFoldersStore,
|
||||
filesActionsStore,
|
||||
filesStore,
|
||||
dialogsStore,
|
||||
settingsStore,
|
||||
accessRightsStore,
|
||||
}) => {
|
||||
const { isRecycleBinFolder, isArchiveFolderRoot } = treeFoldersStore;
|
||||
const {
|
||||
lockFileAction,
|
||||
setFavoriteAction,
|
||||
@ -114,16 +101,17 @@ export default function withQuickButtons(WrappedComponent) {
|
||||
|
||||
const { setSharingPanelVisible } = dialogsStore;
|
||||
const { canWebEdit } = settingsStore;
|
||||
const { canLockFile } = accessRightsStore;
|
||||
|
||||
return {
|
||||
theme: auth.settingsStore.theme,
|
||||
isAdmin: auth.isAdmin,
|
||||
isTrashFolder: isRecycleBinFolder,
|
||||
lockFileAction,
|
||||
setFavoriteAction,
|
||||
onSelectItem,
|
||||
setSharingPanelVisible,
|
||||
canWebEdit,
|
||||
isArchiveFolderRoot,
|
||||
canLockFile,
|
||||
};
|
||||
}
|
||||
)(observer(WithQuickButtons));
|
||||
|
@ -30,6 +30,7 @@ import { isMobileOnly } from "react-device-detect";
|
||||
import IndicatorLoader from "./components/IndicatorLoader";
|
||||
import DialogsWrapper from "./components/dialogs/DialogsWrapper";
|
||||
import MainBar from "./components/MainBar";
|
||||
import { Portal } from "@docspace/components";
|
||||
|
||||
// const { proxyURL } = AppServerConfig;
|
||||
// const homepage = config.homepage;
|
||||
@ -409,10 +410,18 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
setTheme(systemTheme);
|
||||
}, [systemTheme]);
|
||||
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
const toast = isMobileOnly ? (
|
||||
<Portal element={<Toast />} appendTo={rootElement} visible={true} />
|
||||
) : (
|
||||
<Toast />
|
||||
);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Router history={history}>
|
||||
<Toast />
|
||||
{toast}
|
||||
<ReactSmartBanner t={t} ready={ready} />
|
||||
{isEditor || !isMobileOnly ? <></> : <NavMenu />}
|
||||
{isMobileOnly && <MainBar />}
|
||||
|
@ -71,6 +71,7 @@ const Badges = ({
|
||||
setConvertDialogVisible,
|
||||
viewAs,
|
||||
onUnpinClick,
|
||||
canViewVersionFileHistory,
|
||||
}) => {
|
||||
const {
|
||||
id,
|
||||
@ -142,6 +143,10 @@ const Badges = ({
|
||||
"data-id": id,
|
||||
};
|
||||
|
||||
const onShowVersionHistoryProp = canViewVersionFileHistory
|
||||
? { onClick: onShowVersionHistory }
|
||||
: {};
|
||||
|
||||
return fileExst ? (
|
||||
<div className="badges additional-badges temp-badges">
|
||||
{isEditing && (
|
||||
@ -167,13 +172,13 @@ const Badges = ({
|
||||
/>
|
||||
)}
|
||||
{version > 1 && (
|
||||
<BadgeWrapper onClick={onShowVersionHistory} isTile={isTile}>
|
||||
<BadgeWrapper {...onShowVersionHistoryProp} isTile={isTile}>
|
||||
<Badge
|
||||
{...versionBadgeProps}
|
||||
className="badge-version badge-version-current tablet-badge icons-group"
|
||||
backgroundColor={theme.filesBadges.backgroundColor}
|
||||
label={t("VersionBadge", { version: countVersions })}
|
||||
onClick={onShowVersionHistory}
|
||||
{...onShowVersionHistoryProp}
|
||||
noHover={true}
|
||||
isVersionBadge={true}
|
||||
/>
|
||||
|
@ -17,16 +17,16 @@ const QuickButtons = (props) => {
|
||||
theme,
|
||||
sectionWidth,
|
||||
isTrashFolder,
|
||||
accessToEdit,
|
||||
onClickLock,
|
||||
isDisabled,
|
||||
onClickFavorite,
|
||||
viewAs,
|
||||
isCanWebEdit,
|
||||
isArchiveFolderRoot,
|
||||
canLockFile,
|
||||
} = props;
|
||||
|
||||
const { id, locked, fileStatus, title, fileExst } = item;
|
||||
const { id, locked, fileStatus, title, fileExst, access, folderType } = item;
|
||||
const canLockFileAbility = canLockFile(item);
|
||||
|
||||
const isFavorite =
|
||||
(fileStatus & FileStatus.IsFavorite) === FileStatus.IsFavorite;
|
||||
@ -59,12 +59,7 @@ const QuickButtons = (props) => {
|
||||
const setFavorite = () => onClickFavorite(isFavorite);
|
||||
|
||||
const isAvailableLockFile =
|
||||
!isArchiveFolderRoot &&
|
||||
fileExst &&
|
||||
accessToEdit &&
|
||||
!isTrashFolder &&
|
||||
displayBadges &&
|
||||
isCanWebEdit;
|
||||
canLockFileAbility && fileExst && displayBadges && isCanWebEdit;
|
||||
|
||||
return (
|
||||
<div className="badges additional-badges">
|
||||
|
@ -1,11 +1,13 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
import { isMobileOnly } from "react-device-detect";
|
||||
|
||||
import Backdrop from "@docspace/components/backdrop";
|
||||
import Aside from "@docspace/components/aside";
|
||||
import Button from "@docspace/components/button";
|
||||
import toastr from "@docspace/components/toast/toastr";
|
||||
import Portal from "@docspace/components/portal";
|
||||
|
||||
import {
|
||||
StyledBlock,
|
||||
@ -168,19 +170,20 @@ const InvitePanel = ({
|
||||
|
||||
const roomType = selectedRoom ? selectedRoom.roomType : -1;
|
||||
|
||||
return (
|
||||
const invitePanelComponent = (
|
||||
<StyledInvitePanel>
|
||||
<Backdrop
|
||||
onClick={onClose}
|
||||
visible={visible}
|
||||
isAside={true}
|
||||
zIndex={210}
|
||||
zIndex={isMobileOnly ? 10 : 210}
|
||||
/>
|
||||
<Aside
|
||||
className="invite_panel"
|
||||
visible={visible}
|
||||
onClose={onClose}
|
||||
withoutBodyScroll
|
||||
zIndex={310}
|
||||
>
|
||||
<StyledBlock>
|
||||
<StyledHeading>
|
||||
@ -221,6 +224,20 @@ const InvitePanel = ({
|
||||
</Aside>
|
||||
</StyledInvitePanel>
|
||||
);
|
||||
|
||||
const renderPortalInvitePanel = () => {
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
return (
|
||||
<Portal
|
||||
element={invitePanelComponent}
|
||||
appendTo={rootElement}
|
||||
visible={visible}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return isMobileOnly ? renderPortalInvitePanel() : invitePanelComponent;
|
||||
};
|
||||
|
||||
export default inject(({ auth, peopleStore, filesStore, dialogsStore }) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { inject } from "mobx-react";
|
||||
import { ReactSVG } from "react-svg";
|
||||
|
||||
@ -9,14 +9,26 @@ import infoPanel from "@docspace/common/components/Section/sub-components/info-p
|
||||
const CommentEditor = ({
|
||||
t,
|
||||
item,
|
||||
|
||||
editing,
|
||||
setSelection,
|
||||
isRecycleBinFolder,
|
||||
isArchiveFolderRoot,
|
||||
fetchFileVersions,
|
||||
updateCommentVersion,
|
||||
canChangeVersionFileHistory,
|
||||
setVerHistoryFileId,
|
||||
setVerHistoryFileAccess,
|
||||
}) => {
|
||||
const { id, comment, version } = item;
|
||||
const { id, comment, version, access, folderType } = item;
|
||||
|
||||
const changeVersionHistoryAbility = canChangeVersionFileHistory({
|
||||
access,
|
||||
folderType,
|
||||
editing,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
setVerHistoryFileId(id);
|
||||
setVerHistoryFileAccess(access);
|
||||
}, []);
|
||||
|
||||
const [isEdit, setIsEdit] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
@ -32,7 +44,7 @@ const CommentEditor = ({
|
||||
const onSave = async () => {
|
||||
setIsLoading(true);
|
||||
|
||||
await fetchFileVersions(id).catch((err) => {
|
||||
await fetchFileVersions(id, access).catch((err) => {
|
||||
toastr.error(err);
|
||||
setIsLoading(false);
|
||||
});
|
||||
@ -61,7 +73,7 @@ const CommentEditor = ({
|
||||
{comment}
|
||||
</Text>
|
||||
)}
|
||||
{!isRecycleBinFolder && !isArchiveFolderRoot && (
|
||||
{changeVersionHistoryAbility && (
|
||||
<div className="edit_toggle" onClick={onOpenEditor}>
|
||||
<ReactSVG
|
||||
className="edit_toggle-icon"
|
||||
@ -104,17 +116,29 @@ const CommentEditor = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ auth, versionHistoryStore, treeFoldersStore }) => {
|
||||
export default inject(({ auth, versionHistoryStore, accessRightsStore }) => {
|
||||
const { setSelection } = auth.infoPanelStore;
|
||||
|
||||
const { fetchFileVersions, updateCommentVersion } = versionHistoryStore;
|
||||
const { isRecycleBinFolder, isArchiveFolderRoot } = treeFoldersStore;
|
||||
const {
|
||||
fetchFileVersions,
|
||||
updateCommentVersion,
|
||||
isEditingVersion,
|
||||
isEditing,
|
||||
fileId,
|
||||
setVerHistoryFileId,
|
||||
setVerHistoryFileAccess,
|
||||
} = versionHistoryStore;
|
||||
|
||||
const { canChangeVersionFileHistory } = accessRightsStore;
|
||||
const editing = isEditingVersion || isEditing;
|
||||
|
||||
return {
|
||||
setSelection,
|
||||
isRecycleBinFolder,
|
||||
isArchiveFolderRoot,
|
||||
fetchFileVersions,
|
||||
updateCommentVersion,
|
||||
canChangeVersionFileHistory,
|
||||
editing,
|
||||
setVerHistoryFileId,
|
||||
setVerHistoryFileAccess,
|
||||
};
|
||||
})(CommentEditor);
|
||||
|
@ -3,7 +3,6 @@ import React, { useState } from "react";
|
||||
import { StyledUser } from "../../styles/members";
|
||||
import Avatar from "@docspace/components/avatar";
|
||||
import { ComboBox } from "@docspace/components";
|
||||
import { ShareAccessRights } from "@docspace/common/constants";
|
||||
|
||||
const User = ({
|
||||
t,
|
||||
@ -15,7 +14,9 @@ const User = ({
|
||||
currCanEditUsers,
|
||||
selectionParentRoom,
|
||||
setSelectionParentRoom,
|
||||
isArchiveRoot,
|
||||
canChangeUserRoleInRoom,
|
||||
rootFolderType,
|
||||
access,
|
||||
}) => {
|
||||
if (!selectionParentRoom) return null;
|
||||
if (!user.displayName && !user.email) return null;
|
||||
@ -66,11 +67,13 @@ const User = ({
|
||||
}
|
||||
};
|
||||
|
||||
const isAvailable =
|
||||
!isArchiveRoot &&
|
||||
currCanEditUsers &&
|
||||
currentMember?.id !== user.id &&
|
||||
userRole.access !== ShareAccessRights.FullAccess;
|
||||
const isCanChangeUserRole =
|
||||
user &&
|
||||
canChangeUserRoleInRoom({
|
||||
access,
|
||||
rootFolderType,
|
||||
currentUserInList: { id: user.id, access: user.access },
|
||||
});
|
||||
|
||||
return (
|
||||
<StyledUser isExpect={isExpect} key={user.id}>
|
||||
@ -91,7 +94,7 @@ const User = ({
|
||||
|
||||
{userRole && userRoleOptions && (
|
||||
<div className="role-wrapper">
|
||||
{isAvailable ? (
|
||||
{isCanChangeUserRole ? (
|
||||
<ComboBox
|
||||
className="role-combobox"
|
||||
selectedOption={userRole}
|
||||
|
@ -19,7 +19,6 @@ const Members = ({
|
||||
selfId,
|
||||
isOwner,
|
||||
isAdmin,
|
||||
isArchiveRoot,
|
||||
selection,
|
||||
|
||||
selectionParentRoom,
|
||||
@ -33,13 +32,19 @@ const Members = ({
|
||||
|
||||
changeUserType,
|
||||
canInviteUserInRoom,
|
||||
canChangeUserRoleInRoom,
|
||||
}) => {
|
||||
const membersHelper = new MembersHelper({ t });
|
||||
|
||||
const [members, setMembers] = useState(null);
|
||||
const [showLoader, setShowLoader] = useState(false);
|
||||
const { access, rootFolderType } = selection;
|
||||
|
||||
const canInviteUserInRoomAbility = canInviteUserInRoom({
|
||||
access,
|
||||
rootFolderType,
|
||||
});
|
||||
|
||||
const isDisabledInvite = !canInviteUserInRoom({ access: selection.access });
|
||||
const fetchMembers = async (roomId) => {
|
||||
let timerId;
|
||||
if (members) timerId = setTimeout(() => setShowLoader(true), 1000);
|
||||
@ -117,19 +122,13 @@ const Members = ({
|
||||
(member) => member.id === selfId
|
||||
);
|
||||
|
||||
const currCanEditUsers =
|
||||
isOwner ||
|
||||
isAdmin ||
|
||||
currentMember?.access === ShareAccessRights.FullAccess ||
|
||||
currentMember?.access === ShareAccessRights.RoomManager;
|
||||
|
||||
return (
|
||||
<>
|
||||
<StyledUserTypeHeader>
|
||||
<Text className="title">
|
||||
{t("UsersInRoom")} : {members.inRoom.length}
|
||||
</Text>
|
||||
{currCanEditUsers && !isArchiveRoot && (
|
||||
{canInviteUserInRoomAbility && (
|
||||
<IconButton
|
||||
className={"icon"}
|
||||
title={t("Common:AddUsers")}
|
||||
@ -137,7 +136,6 @@ const Members = ({
|
||||
isFill={true}
|
||||
onClick={onClickInviteUsers}
|
||||
size={16}
|
||||
isDisabled={isDisabledInvite}
|
||||
/>
|
||||
)}
|
||||
</StyledUserTypeHeader>
|
||||
@ -145,7 +143,8 @@ const Members = ({
|
||||
<StyledUserList>
|
||||
{Object.values(members.inRoom).map((user) => (
|
||||
<User
|
||||
currCanEditUsers={currCanEditUsers}
|
||||
access={access}
|
||||
rootFolderType={rootFolderType}
|
||||
key={user.id}
|
||||
t={t}
|
||||
user={user}
|
||||
@ -156,7 +155,7 @@ const Members = ({
|
||||
roomType={selectionParentRoom.roomType}
|
||||
selectionParentRoom={selectionParentRoom}
|
||||
setSelectionParentRoom={setSelectionParentRoom}
|
||||
isArchiveRoot={isArchiveRoot}
|
||||
canChangeUserRoleInRoom={canChangeUserRoleInRoom}
|
||||
/>
|
||||
))}
|
||||
</StyledUserList>
|
||||
@ -164,7 +163,7 @@ const Members = ({
|
||||
{!!members.expected.length && (
|
||||
<StyledUserTypeHeader isExpect>
|
||||
<Text className="title">{t("ExpectPeople")}</Text>
|
||||
{currCanEditUsers && !isArchiveRoot && (
|
||||
{canInviteUserInRoomAbility && (
|
||||
<IconButton
|
||||
className={"icon"}
|
||||
title={t("Repeat invitation")}
|
||||
@ -180,6 +179,8 @@ const Members = ({
|
||||
<StyledUserList>
|
||||
{Object.values(members.expected).map((user) => (
|
||||
<User
|
||||
access={access}
|
||||
rootFolderType={rootFolderType}
|
||||
isExpect
|
||||
key={user.id}
|
||||
t={t}
|
||||
@ -191,7 +192,6 @@ const Members = ({
|
||||
roomType={selectionParentRoom.roomType}
|
||||
selectionParentRoom={selectionParentRoom}
|
||||
setSelectionParentRoom={setSelectionParentRoom}
|
||||
isArchiveRoot={isArchiveRoot}
|
||||
/>
|
||||
))}
|
||||
</StyledUserList>
|
||||
@ -200,14 +200,7 @@ const Members = ({
|
||||
};
|
||||
|
||||
export default inject(
|
||||
({
|
||||
auth,
|
||||
filesStore,
|
||||
peopleStore,
|
||||
dialogsStore,
|
||||
accessRightsStore,
|
||||
treeFoldersStore,
|
||||
}) => {
|
||||
({ auth, filesStore, peopleStore, dialogsStore, accessRightsStore }) => {
|
||||
const { selectionParentRoom, setSelectionParentRoom } = auth.infoPanelStore;
|
||||
const {
|
||||
getRoomMembers,
|
||||
@ -217,9 +210,7 @@ export default inject(
|
||||
const { isOwner, isAdmin, id: selfId } = auth.userStore.user;
|
||||
const { setInvitePanelOptions } = dialogsStore;
|
||||
const { changeType: changeUserType } = peopleStore;
|
||||
const { canInviteUserInRoom } = accessRightsStore;
|
||||
|
||||
const { isArchiveFolderRoot } = treeFoldersStore;
|
||||
const { canInviteUserInRoom, canChangeUserRoleInRoom } = accessRightsStore;
|
||||
|
||||
return {
|
||||
selectionParentRoom,
|
||||
@ -237,7 +228,7 @@ export default inject(
|
||||
|
||||
changeUserType,
|
||||
canInviteUserInRoom,
|
||||
isArchiveRoot: isArchiveFolderRoot,
|
||||
canChangeUserRoleInRoom,
|
||||
};
|
||||
}
|
||||
)(
|
||||
|
@ -358,14 +358,14 @@ class SectionHeaderContent extends React.Component {
|
||||
key: "empty-archive",
|
||||
label: t("ArchiveAction"),
|
||||
onClick: this.onEmptyTrashAction,
|
||||
disabled: !canRestoreAll,
|
||||
disabled: !canDeleteAll,
|
||||
icon: "images/clear.trash.react.svg",
|
||||
},
|
||||
{
|
||||
key: "restore-all",
|
||||
label: t("RestoreAll"),
|
||||
onClick: this.onRestoreAllArchiveAction,
|
||||
disabled: !canDeleteAll,
|
||||
disabled: !canRestoreAll,
|
||||
icon: "images/subtract.react.svg",
|
||||
},
|
||||
];
|
||||
|
@ -22,6 +22,8 @@ const Backup = ({
|
||||
return (
|
||||
<>
|
||||
<HelpButton
|
||||
displayType="auto"
|
||||
place="bottom"
|
||||
iconName={"/static/images/help.react.svg"}
|
||||
tooltipContent={
|
||||
<>
|
||||
|
@ -91,7 +91,8 @@ let paymentTerm,
|
||||
fromDate,
|
||||
byDate,
|
||||
delayDaysCount,
|
||||
payerInfo = null;
|
||||
payerInfo = null,
|
||||
isAlreadyPaid = false;
|
||||
const PaymentsPage = ({
|
||||
setPortalPaymentQuotas,
|
||||
language,
|
||||
@ -109,27 +110,22 @@ const PaymentsPage = ({
|
||||
startValue,
|
||||
dueDate,
|
||||
delayDueDate,
|
||||
portalStatus,
|
||||
replaceFeaturesValues,
|
||||
portalPaymentQuotasFeatures,
|
||||
setReplacingValuesInTranslation,
|
||||
currentTariffPlanTitle,
|
||||
tariffPlanTitle,
|
||||
expandArticle,
|
||||
setPortalQuota,
|
||||
currentPortalQuota,
|
||||
portalTariffStatus,
|
||||
portalPaymentQuotas,
|
||||
}) => {
|
||||
const { t, ready } = useTranslation(["Payments", "Common", "Settings"]);
|
||||
|
||||
const [isInitialLoading, setIsInitialLoading] = useState(true);
|
||||
|
||||
const isAlreadyPaid = payerEmail.length !== 0 || !isFreeTariff;
|
||||
|
||||
useEffect(() => {
|
||||
setDocumentTitle(t("Settings:Payments"));
|
||||
}, [ready]);
|
||||
useEffect(() => {
|
||||
if (ready && portalPaymentQuotasFeatures.length !== 0)
|
||||
replaceFeaturesValues(t);
|
||||
}, [ready, portalPaymentQuotasFeatures]);
|
||||
|
||||
const gracePeriodDays = () => {
|
||||
const fromDateMoment = moment(dueDate);
|
||||
@ -153,16 +149,30 @@ const PaymentsPage = ({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
moment.locale(language);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (ready && Object.keys(portalPaymentQuotas).length !== 0)
|
||||
setReplacingValuesInTranslation(t);
|
||||
}, [ready, portalPaymentQuotas.title]);
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
if (
|
||||
Object.keys(currentPortalQuota).length === 0 ||
|
||||
Object.keys(portalTariffStatus).length === 0
|
||||
)
|
||||
return;
|
||||
|
||||
isAlreadyPaid = payerEmail.length !== 0 || !isFreeTariff;
|
||||
|
||||
const requests = [getSettingsPayment(), setPortalQuota()];
|
||||
|
||||
if (!currencySymbol && !startValue)
|
||||
requests.push(setPortalPaymentQuotas());
|
||||
|
||||
if (portalStatus !== TariffState.Trial)
|
||||
requests.push(setPaymentAccount());
|
||||
if (isAlreadyPaid) requests.push(setPaymentAccount());
|
||||
|
||||
try {
|
||||
await Promise.all(requests);
|
||||
@ -180,7 +190,7 @@ const PaymentsPage = ({
|
||||
|
||||
setIsInitialLoading(false);
|
||||
})();
|
||||
}, []);
|
||||
}, [currentPortalQuota.title, portalTariffStatus.state]);
|
||||
|
||||
const renderTooltip = () => {
|
||||
return (
|
||||
@ -417,6 +427,7 @@ export default inject(({ auth, payments }) => {
|
||||
isFreeTariff,
|
||||
currentTariffPlanTitle,
|
||||
setPortalQuota,
|
||||
currentPortalQuota,
|
||||
} = currentQuotaStore;
|
||||
const {
|
||||
isNotPaidPeriod,
|
||||
@ -425,15 +436,15 @@ export default inject(({ auth, payments }) => {
|
||||
customerId,
|
||||
dueDate,
|
||||
delayDueDate,
|
||||
portalStatus,
|
||||
portalTariffStatus,
|
||||
} = currentTariffStatusStore;
|
||||
|
||||
const {
|
||||
setPortalPaymentQuotas,
|
||||
planCost,
|
||||
replaceFeaturesValues,
|
||||
portalPaymentQuotasFeatures,
|
||||
setReplacingValuesInTranslation,
|
||||
tariffPlanTitle,
|
||||
portalPaymentQuotas,
|
||||
} = paymentQuotasStore;
|
||||
const { organizationName, theme } = auth.settingsStore;
|
||||
|
||||
@ -467,10 +478,11 @@ export default inject(({ auth, payments }) => {
|
||||
setPortalPaymentQuotas,
|
||||
dueDate,
|
||||
delayDueDate,
|
||||
portalStatus,
|
||||
replaceFeaturesValues,
|
||||
portalPaymentQuotasFeatures,
|
||||
setReplacingValuesInTranslation,
|
||||
currentTariffPlanTitle,
|
||||
setPortalQuota,
|
||||
currentPortalQuota,
|
||||
portalTariffStatus,
|
||||
portalPaymentQuotas,
|
||||
};
|
||||
})(withRouter(observer(PaymentsPage)));
|
||||
|
@ -16,7 +16,6 @@ import { inject, observer } from "mobx-react";
|
||||
import toastr from "@docspace/components/toast/toastr";
|
||||
import { Encoder } from "@docspace/common/utils/encoder";
|
||||
import { Base } from "@docspace/components/themes";
|
||||
import { getFileRoleActions } from "@docspace/common/utils/actions";
|
||||
|
||||
const StyledExternalLinkIcon = styled(ExternalLinkIcon)`
|
||||
${commonIconsStyles}
|
||||
@ -42,16 +41,12 @@ const VersionRow = (props) => {
|
||||
versionsListLength,
|
||||
isEditing,
|
||||
theme,
|
||||
isArchiveFolderRoot,
|
||||
canChangeVersionFileHistory,
|
||||
} = props;
|
||||
const [showEditPanel, setShowEditPanel] = useState(false);
|
||||
const [commentValue, setCommentValue] = useState(info.comment);
|
||||
const [isSavingComment, setIsSavingComment] = useState(false);
|
||||
|
||||
const { changeVersionHistory } = getFileRoleActions(info.access);
|
||||
|
||||
const canEdit = changeVersionHistory && !isEditing;
|
||||
|
||||
const title = `${new Date(info.updated).toLocaleString(
|
||||
culture
|
||||
)} ${Encoder.htmlDecode(info.updatedBy?.displayName)}`;
|
||||
@ -95,15 +90,13 @@ const VersionRow = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const isAvailableEdit = canEdit && !isArchiveFolderRoot;
|
||||
|
||||
const contextOptions = [
|
||||
isAvailableEdit && {
|
||||
canChangeVersionFileHistory && {
|
||||
key: "edit",
|
||||
label: t("EditComment"),
|
||||
onClick: onEditComment,
|
||||
},
|
||||
isAvailableEdit && {
|
||||
canChangeVersionFileHistory && {
|
||||
key: "restore",
|
||||
label: t("Common:Restore"),
|
||||
onClick: onRestoreClick,
|
||||
@ -115,7 +108,9 @@ const VersionRow = (props) => {
|
||||
},
|
||||
];
|
||||
|
||||
const onClickProp = isAvailableEdit ? { onClick: onVersionClick } : {};
|
||||
const onClickProp = canChangeVersionFileHistory
|
||||
? { onClick: onVersionClick }
|
||||
: {};
|
||||
|
||||
useEffect(() => {
|
||||
const newRowHeight = document.getElementsByClassName(
|
||||
@ -129,7 +124,7 @@ const VersionRow = (props) => {
|
||||
<StyledVersionRow
|
||||
showEditPanel={showEditPanel}
|
||||
contextOptions={contextOptions}
|
||||
canEdit={isAvailableEdit}
|
||||
canEdit={canChangeVersionFileHistory}
|
||||
isTabletView={isTabletView}
|
||||
isSavingComment={isSavingComment}
|
||||
isEditing={isEditing}
|
||||
@ -225,7 +220,8 @@ const VersionRow = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ auth, versionHistoryStore, treeFoldersStore }) => {
|
||||
export default inject(
|
||||
({ auth, versionHistoryStore, accessRightsStore, selectedFolderStore }) => {
|
||||
const { user } = auth.userStore;
|
||||
const { culture, isTabletView } = auth.settingsStore;
|
||||
const language = (user && user.cultureName) || culture || "en";
|
||||
@ -236,9 +232,19 @@ export default inject(({ auth, versionHistoryStore, treeFoldersStore }) => {
|
||||
updateCommentVersion,
|
||||
isEditing,
|
||||
isEditingVersion,
|
||||
fileAccess,
|
||||
} = versionHistoryStore;
|
||||
|
||||
const { isArchiveFolderRoot } = treeFoldersStore;
|
||||
const { rootFolderType } = selectedFolderStore;
|
||||
|
||||
const isEdit = isEditingVersion || isEditing;
|
||||
const canChangeVersionFileHistory = accessRightsStore.canChangeVersionFileHistory(
|
||||
{
|
||||
access: fileAccess,
|
||||
rootFolderType,
|
||||
editing: isEdit,
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
theme: auth.settingsStore.theme,
|
||||
@ -247,10 +253,11 @@ export default inject(({ auth, versionHistoryStore, treeFoldersStore }) => {
|
||||
markAsVersion,
|
||||
restoreVersion,
|
||||
updateCommentVersion,
|
||||
isEditing: isEditingVersion || isEditing,
|
||||
isArchiveFolderRoot,
|
||||
isEditing: isEdit,
|
||||
canChangeVersionFileHistory,
|
||||
};
|
||||
})(
|
||||
}
|
||||
)(
|
||||
withRouter(
|
||||
withTranslation(["VersionHistory", "Common", "Translations"])(
|
||||
observer(VersionRow)
|
||||
|
@ -24,15 +24,15 @@ class SectionBodyContent extends React.Component {
|
||||
const fileId = match.params.fileId || this.props.fileId;
|
||||
|
||||
if (fileId && fileId !== this.props.fileId) {
|
||||
this.getFileVersions(fileId);
|
||||
this.getFileVersions(fileId, fileAccess);
|
||||
setFirstLoad(false);
|
||||
}
|
||||
}
|
||||
|
||||
getFileVersions = (fileId) => {
|
||||
getFileVersions = (fileId, fileAccess) => {
|
||||
const { fetchFileVersions, setIsLoading } = this.props;
|
||||
setIsLoading(true);
|
||||
fetchFileVersions(fileId).then(() => setIsLoading(false));
|
||||
fetchFileVersions(fileId, fileAccess).then(() => setIsLoading(false));
|
||||
};
|
||||
|
||||
onSetRestoreProcess = (restoring) => {
|
||||
@ -138,14 +138,19 @@ class SectionBodyContent extends React.Component {
|
||||
|
||||
export default inject(({ auth, filesStore, versionHistoryStore }) => {
|
||||
const { setFirstLoad, setIsLoading, isLoading } = filesStore;
|
||||
const { versions, fetchFileVersions, fileId } = versionHistoryStore;
|
||||
const {
|
||||
versions,
|
||||
fetchFileVersions,
|
||||
fileId,
|
||||
fileAccess,
|
||||
} = versionHistoryStore;
|
||||
|
||||
return {
|
||||
culture: auth.settingsStore.culture,
|
||||
isLoading,
|
||||
versions,
|
||||
fileId,
|
||||
|
||||
fileAccess,
|
||||
setFirstLoad,
|
||||
setIsLoading,
|
||||
fetchFileVersions,
|
||||
|
@ -10,11 +10,13 @@ import {
|
||||
getFileRoleActions,
|
||||
getRoomRoleActions,
|
||||
getArchiveRoomRoleActions,
|
||||
getArchiveFileRoleActions,
|
||||
} from "@docspace/common/utils/actions";
|
||||
|
||||
class AccessRightsStore {
|
||||
authStore = null;
|
||||
selectedFolderStore = null;
|
||||
treeFoldersStore = null;
|
||||
|
||||
constructor(authStore, selectedFolderStore) {
|
||||
this.authStore = authStore;
|
||||
@ -23,14 +25,133 @@ class AccessRightsStore {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
canInviteUserInRoom = (room) => {
|
||||
const { rootFolderType } = this.selectedFolderStore;
|
||||
canInviteUserInRoom(room) {
|
||||
const { access, rootFolderType } = room;
|
||||
|
||||
if (rootFolderType === FolderType.Archive) return false;
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveRoomRoleActions(access).inviteUsers;
|
||||
|
||||
const { inviteUsers } = getRoomRoleActions(room.access);
|
||||
return getRoomRoleActions(access).inviteUsers;
|
||||
}
|
||||
|
||||
return inviteUsers;
|
||||
canChangeUserRoleInRoom = (room) => {
|
||||
const { access, rootFolderType, currentUserInList } = room;
|
||||
const { userStore } = this.authStore;
|
||||
const { user } = userStore;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveRoomRoleActions(access).changeUserRole;
|
||||
|
||||
const isMyProfile = user.id === currentUserInList.id;
|
||||
const isOwnerRoleRoom =
|
||||
currentUserInList.access === ShareAccessRights.FullAccess;
|
||||
|
||||
if (isMyProfile || isOwnerRoleRoom) return false;
|
||||
|
||||
return getRoomRoleActions(access).changeUserRole;
|
||||
};
|
||||
|
||||
canLockFile = (file) => {
|
||||
const { rootFolderType, access } = file;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).block;
|
||||
|
||||
if (rootFolderType === FolderType.TRASH) return false;
|
||||
|
||||
return getFileRoleActions(access).block;
|
||||
};
|
||||
|
||||
canChangeVersionFileHistory = (file) => {
|
||||
const { rootFolderType, editing, providerKey, access } = file;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).changeVersionHistory;
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
// rootFolderType === FolderType.Privacy ||
|
||||
editing ||
|
||||
providerKey
|
||||
)
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).changeVersionHistory;
|
||||
};
|
||||
canViewVersionFileHistory = (file) => {
|
||||
const { rootFolderType, access, providerKey } = file;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).viewVersionHistory;
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
// rootFolderType === FolderType.Privacy ||
|
||||
providerKey
|
||||
)
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).viewVersionHistory;
|
||||
};
|
||||
|
||||
canEditFile = (file) => {
|
||||
const { rootFolderType, access } = file;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).edit;
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH
|
||||
// || rootFolderType === FolderType.Privacy
|
||||
)
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).edit;
|
||||
};
|
||||
|
||||
canRenameItem = (item = {}) => {
|
||||
const { rootFolderType, access, isFile } = item;
|
||||
const { isDesktopClient } = this.authStore.settingsStore;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).rename;
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
(!isFile &&
|
||||
// rootFolderType === FolderType.Privacy &&
|
||||
!isDesktopClient)
|
||||
)
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).rename;
|
||||
};
|
||||
canFillForm = (file) => {
|
||||
const { rootFolderType, access } = file;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).fillForm;
|
||||
|
||||
if (rootFolderType === FolderType.TRASH) return false;
|
||||
|
||||
return getFileRoleActions(access).fillForm;
|
||||
};
|
||||
|
||||
canMakeForm = (item) => {
|
||||
const { rootFolderType, access } = item;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).saveAsForm;
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
// rootFolderType === FolderType.Privacy ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent
|
||||
)
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).saveAsForm;
|
||||
};
|
||||
|
||||
canArchiveRoom = (room) => {
|
||||
@ -40,51 +161,130 @@ class AccessRightsStore {
|
||||
};
|
||||
|
||||
canRemoveRoom = (room) => {
|
||||
const { delete: remove } = getRoomRoleActions(room.access);
|
||||
const { access, rootFolderType } = room;
|
||||
|
||||
return remove;
|
||||
if (rootFolderType !== FolderType.Archive)
|
||||
return getRoomRoleActions(access).delete;
|
||||
|
||||
return getArchiveRoomRoleActions(access).delete;
|
||||
};
|
||||
|
||||
canViewRoomInfo = (room) => {
|
||||
const { access, rootFolderType } = room;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveRoomRoleActions(access).viewInfo;
|
||||
|
||||
return getRoomRoleActions(access).viewInfo;
|
||||
};
|
||||
|
||||
canPinRoom = (room) => {
|
||||
const { access, rootFolderType } = room;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveRoomRoleActions(access).canPin;
|
||||
|
||||
return getRoomRoleActions(access).canPin;
|
||||
};
|
||||
|
||||
canEditRoom = (room) => {
|
||||
const { access, rootFolderType } = room;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveRoomRoleActions(access).edit;
|
||||
|
||||
return getRoomRoleActions(access).edit;
|
||||
};
|
||||
|
||||
get canCreateFiles() {
|
||||
const { access, rootFolderType } = this.selectedFolderStore;
|
||||
|
||||
if (rootFolderType === FolderType.Archive) return false;
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).create;
|
||||
|
||||
const { create } = getFileRoleActions(access);
|
||||
|
||||
return create;
|
||||
}
|
||||
|
||||
canMoveFile = (room) => {
|
||||
const { rootFolderType } = room;
|
||||
canMoveItems = (item) => {
|
||||
const { rootFolderType, access, editing: fileEditing, providerKey } = item;
|
||||
|
||||
if (rootFolderType === FolderType.Archive) return false;
|
||||
if (rootFolderType === FolderType.Archive) {
|
||||
const { moveSelf, moveAlien } = getArchiveFileRoleActions(access);
|
||||
|
||||
const { moveSelf, moveAlien } = getFileRoleActions(room.access);
|
||||
return moveSelf || moveAlien;
|
||||
}
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent ||
|
||||
// rootFolderType === FolderType.Privacy ||
|
||||
providerKey ||
|
||||
fileEditing
|
||||
)
|
||||
return false;
|
||||
|
||||
const { moveSelf, moveAlien } = getFileRoleActions(access);
|
||||
|
||||
return moveSelf || moveAlien;
|
||||
};
|
||||
|
||||
canDeleteFile = (room) => {
|
||||
const { rootFolderType } = room;
|
||||
canDeleteItems = (item) => {
|
||||
const { rootFolderType, access, editing: fileEditing } = item;
|
||||
|
||||
if (rootFolderType === FolderType.Archive) return false;
|
||||
if (rootFolderType === FolderType.Archive) {
|
||||
const { deleteSelf, deleteAlien } = getArchiveFileRoleActions(access);
|
||||
|
||||
const { deleteSelf, deleteAlien } = getFileRoleActions(room.access);
|
||||
return deleteSelf || deleteAlien;
|
||||
}
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent ||
|
||||
// rootFolderType === FolderType.Privacy ||
|
||||
fileEditing
|
||||
)
|
||||
return false;
|
||||
|
||||
const { deleteSelf, deleteAlien } = getFileRoleActions(access);
|
||||
|
||||
return deleteSelf || deleteAlien;
|
||||
};
|
||||
|
||||
canCopyFile = (room) => {
|
||||
const { rootFolderType } = room;
|
||||
canCopyItems = (item) => {
|
||||
const { rootFolderType, access } = item;
|
||||
|
||||
if (rootFolderType === FolderType.Archive) return false;
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent
|
||||
// || rootFolderType === FolderType.Privacy
|
||||
)
|
||||
return false;
|
||||
|
||||
const { copyFromPersonal } = getFileRoleActions(room.access);
|
||||
const { canCopy } = getFileRoleActions(access);
|
||||
|
||||
return copyFromPersonal;
|
||||
return canCopy;
|
||||
};
|
||||
canDuplicateFile = (item) => {
|
||||
const { rootFolderType, access } = item;
|
||||
|
||||
if (rootFolderType === FolderType.Archive)
|
||||
return getArchiveFileRoleActions(access).canDuplicate;
|
||||
|
||||
if (
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent
|
||||
// || rootFolderType === FolderType.Privacy
|
||||
)
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).canDuplicate;
|
||||
};
|
||||
canChangeUserType = (user) => {
|
||||
const { id, isOwner } = this.authStore.userStore.user;
|
||||
|
||||
|
@ -489,7 +489,7 @@ class ContextOptionsStore {
|
||||
key: "show-version-history",
|
||||
label: t("ShowVersionHistory"),
|
||||
icon: "images/history.react.svg",
|
||||
onClick: () => this.showVersionHistory(item.id),
|
||||
onClick: () => this.showVersionHistory(item.id, item.access),
|
||||
disabled: false,
|
||||
},
|
||||
]
|
||||
@ -503,14 +503,15 @@ class ContextOptionsStore {
|
||||
key: "finalize-version",
|
||||
label: t("FinalizeVersion"),
|
||||
icon: "images/history-finalized.react.svg",
|
||||
onClick: () => this.finalizeVersion(item.id),
|
||||
onClick: () => this.finalizeVersion(item.id, item.access),
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
key: "show-version-history",
|
||||
label: t("ShowVersionHistory"),
|
||||
icon: "images/history.react.svg",
|
||||
onClick: () => this.showVersionHistory(item.id),
|
||||
onClick: () =>
|
||||
this.showVersionHistory(item.id, item.access),
|
||||
disabled: false,
|
||||
},
|
||||
],
|
||||
@ -528,7 +529,7 @@ class ContextOptionsStore {
|
||||
key: "show-version-history",
|
||||
label: t("ShowVersionHistory"),
|
||||
icon: "images/history.react.svg",
|
||||
onClick: () => this.showVersionHistory(item.id),
|
||||
onClick: () => this.showVersionHistory(item.id, item.access),
|
||||
disabled: false,
|
||||
},
|
||||
]
|
||||
@ -888,6 +889,21 @@ class ContextOptionsStore {
|
||||
if (isRoomsFolder || isArchiveFolder) {
|
||||
const isPinOption = selection.filter((item) => !item.pinned).length > 0;
|
||||
|
||||
const canDelete =
|
||||
selection.findIndex((k) => k.contextOptions.includes("delete")) !== -1;
|
||||
|
||||
const canArchiveRoom =
|
||||
selection.findIndex((k) =>
|
||||
k.contextOptions.includes("archive-room")
|
||||
) !== -1;
|
||||
|
||||
const canRestoreRoom =
|
||||
selection.findIndex((k) =>
|
||||
k.contextOptions.includes("unarchive-room")
|
||||
) !== -1;
|
||||
|
||||
let archiveOptions;
|
||||
|
||||
const pinOption = isPinOption
|
||||
? {
|
||||
key: "pin-room",
|
||||
@ -904,8 +920,8 @@ class ContextOptionsStore {
|
||||
disabled: false,
|
||||
};
|
||||
|
||||
const archiveOptions = !isArchiveFolder
|
||||
? {
|
||||
if (canArchiveRoom) {
|
||||
archiveOptions = {
|
||||
key: "archive-room",
|
||||
label: t("Archived"),
|
||||
icon: "/static/images/room.archive.svg",
|
||||
@ -913,8 +929,10 @@ class ContextOptionsStore {
|
||||
disabled: false,
|
||||
"data-action": "archive",
|
||||
action: "archive",
|
||||
};
|
||||
}
|
||||
: {
|
||||
if (canRestoreRoom) {
|
||||
archiveOptions = {
|
||||
key: "unarchive-room",
|
||||
label: t("Common:Restore"),
|
||||
icon: "images/subtract.react.svg",
|
||||
@ -923,6 +941,7 @@ class ContextOptionsStore {
|
||||
"data-action": "unarchive",
|
||||
action: "unarchive",
|
||||
};
|
||||
}
|
||||
|
||||
const options = [];
|
||||
|
||||
@ -936,14 +955,13 @@ class ContextOptionsStore {
|
||||
|
||||
options.push(archiveOptions);
|
||||
|
||||
if (isArchiveFolder) {
|
||||
canDelete &&
|
||||
options.push({
|
||||
key: "delete-rooms",
|
||||
label: t("Common:Delete"),
|
||||
icon: "images/trash.react.svg",
|
||||
onClick: () => deleteRooms(t),
|
||||
});
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
@ -1257,20 +1257,18 @@ class FilesActionStore {
|
||||
};
|
||||
|
||||
isAvailableOption = (option) => {
|
||||
const { isFavoritesFolder, isRecentFolder } = this.treeFoldersStore;
|
||||
const {
|
||||
isAccessedSelected,
|
||||
canConvertSelected,
|
||||
isThirdPartyRootSelection,
|
||||
hasSelection,
|
||||
allFilesIsEditing,
|
||||
selection,
|
||||
} = this.filesStore;
|
||||
|
||||
const {
|
||||
canCopyFile,
|
||||
canDeleteFile,
|
||||
canMoveFile,
|
||||
canCopyItems,
|
||||
canDeleteItems,
|
||||
canMoveItems,
|
||||
canArchiveRoom,
|
||||
canRemoveRoom,
|
||||
} = this.accessRightsStore;
|
||||
@ -1278,7 +1276,7 @@ class FilesActionStore {
|
||||
|
||||
switch (option) {
|
||||
case "copy":
|
||||
const canCopy = canCopyFile({ access, rootFolderType });
|
||||
const canCopy = canCopyItems({ access, rootFolderType });
|
||||
|
||||
return hasSelection && canCopy;
|
||||
case "showInfo":
|
||||
@ -1287,16 +1285,12 @@ class FilesActionStore {
|
||||
case "downloadAs":
|
||||
return canConvertSelected;
|
||||
case "moveTo":
|
||||
const canMove = canMoveFile({ access, rootFolderType });
|
||||
return (
|
||||
!isThirdPartyRootSelection &&
|
||||
hasSelection &&
|
||||
isAccessedSelected &&
|
||||
!isRecentFolder &&
|
||||
!isFavoritesFolder &&
|
||||
!allFilesIsEditing &&
|
||||
canMove
|
||||
);
|
||||
const canMove = canMoveItems({
|
||||
access,
|
||||
rootFolderType,
|
||||
editing: allFilesIsEditing,
|
||||
});
|
||||
return hasSelection && isAccessedSelected && canMove;
|
||||
|
||||
case "archive":
|
||||
case "unarchive":
|
||||
@ -1313,12 +1307,12 @@ class FilesActionStore {
|
||||
return canRemove.length > 0;
|
||||
|
||||
case "delete":
|
||||
const canDelete = canDeleteFile({ access, rootFolderType });
|
||||
const deleteCondition =
|
||||
!isThirdPartyRootSelection &&
|
||||
hasSelection &&
|
||||
isAccessedSelected &&
|
||||
!allFilesIsEditing;
|
||||
const canDelete = canDeleteItems({
|
||||
access,
|
||||
rootFolderType,
|
||||
editing: allFilesIsEditing,
|
||||
});
|
||||
const deleteCondition = hasSelection && isAccessedSelected;
|
||||
|
||||
return canDelete && deleteCondition;
|
||||
}
|
||||
|
@ -26,10 +26,7 @@ import {
|
||||
import { isDesktop } from "@docspace/components/utils/device";
|
||||
import { getContextMenuKeysByType } from "SRC_DIR/helpers/plugins";
|
||||
import { PluginContextMenuItemType } from "SRC_DIR/helpers/plugins/constants";
|
||||
import {
|
||||
getFileRoleActions,
|
||||
getRoomRoleActions,
|
||||
} from "@docspace/common/utils/actions";
|
||||
import { getArchiveRoomRoleActions } from "@docspace/common/utils/actions";
|
||||
|
||||
const { FilesFilter, RoomsFilter } = api;
|
||||
const storageViewAs = localStorage.getItem("viewAs");
|
||||
@ -1047,23 +1044,13 @@ class FilesStore {
|
||||
const isDocuSign = false; //TODO: need this prop;
|
||||
const isEditing =
|
||||
(item.fileStatus & FileStatus.IsEditing) === FileStatus.IsEditing;
|
||||
const isFileOwner =
|
||||
item.createdBy?.id === this.authStore.userStore.user?.id;
|
||||
// const isFileOwner =
|
||||
// item.createdBy?.id === this.authStore.userStore.user?.id;
|
||||
|
||||
const {
|
||||
isRecycleBinFolder,
|
||||
isPrivacyFolder,
|
||||
isRecentFolder,
|
||||
isFavoritesFolder,
|
||||
isShareFolder,
|
||||
isMy,
|
||||
isArchiveFolder,
|
||||
} = this.treeFoldersStore;
|
||||
const { isRecycleBinFolder, isMy, isArchiveFolder } = this.treeFoldersStore;
|
||||
|
||||
const { canFormFillingDocs } = this.filesSettingsStore;
|
||||
|
||||
const filesRights = getFileRoleActions(item.access);
|
||||
|
||||
const { enablePlugins } = this.authStore.settingsStore;
|
||||
|
||||
const isThirdPartyFolder =
|
||||
@ -1076,10 +1063,39 @@ class FilesStore {
|
||||
const pluginAllKeys =
|
||||
enablePlugins && getContextMenuKeysByType(PluginContextMenuItemType.All);
|
||||
|
||||
const canRenameItem = this.accessRightsStore.canRenameItem({
|
||||
...item,
|
||||
...isFile,
|
||||
});
|
||||
|
||||
const canMove = this.accessRightsStore.canMoveItems({
|
||||
...item,
|
||||
...{ editing: isEditing },
|
||||
});
|
||||
|
||||
const canDelete = this.accessRightsStore.canDeleteItems({
|
||||
...item,
|
||||
...{ editing: isEditing },
|
||||
});
|
||||
|
||||
const canCopy = this.accessRightsStore.canCopyItems(item);
|
||||
const canCreateCopy = this.accessRightsStore.canDuplicateFile(item);
|
||||
|
||||
if (isFile) {
|
||||
const shouldFillForm = canFormFillingDocs(item.fileExst);
|
||||
const canLockFile = this.accessRightsStore.canLockFile(item);
|
||||
const canChangeVersionFileHistory = this.accessRightsStore.canChangeVersionFileHistory(
|
||||
{ ...item, ...{ editing: isEditing } }
|
||||
);
|
||||
|
||||
const canViewVersionFileHistory = this.accessRightsStore.canViewVersionFileHistory(
|
||||
item
|
||||
);
|
||||
const canFillForm = this.accessRightsStore.canFillForm(item);
|
||||
|
||||
const canEditFile = this.accessRightsStore.canEditFile(item);
|
||||
const isMasterForm = item.fileExst === ".docxf";
|
||||
const canMakeForm = this.accessRightsStore.canMakeForm(item);
|
||||
|
||||
let fileOptions = [
|
||||
//"open",
|
||||
@ -1105,7 +1121,7 @@ class FilesStore {
|
||||
"open-location",
|
||||
"mark-read",
|
||||
// "mark-as-favorite",
|
||||
"remove-from-favorites",
|
||||
// "remove-from-favorites",
|
||||
"download",
|
||||
"download-as",
|
||||
"convert",
|
||||
@ -1120,75 +1136,69 @@ class FilesStore {
|
||||
"delete",
|
||||
];
|
||||
|
||||
if (!filesRights.edit) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["edit"]);
|
||||
}
|
||||
if (!filesRights.fillForm) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["fill-form"]);
|
||||
}
|
||||
if (!filesRights.blockFile) {
|
||||
if (!canLockFile) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"block-unblock-version",
|
||||
]);
|
||||
}
|
||||
if (!filesRights.viewVersionHistory) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["show-version-history"]);
|
||||
}
|
||||
if (!filesRights.changeVersionHistory) {
|
||||
|
||||
if (!canChangeVersionFileHistory) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["finalize-version"]);
|
||||
}
|
||||
if (!filesRights.deleteSelf || !filesRights.deleteAlien) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["delete"]);
|
||||
|
||||
if (!canViewVersionFileHistory) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["show-version-history"]);
|
||||
}
|
||||
if (!filesRights.moveSelf || !filesRights.moveAlien) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["move-to"]);
|
||||
}
|
||||
if (!filesRights.rename) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["rename"]);
|
||||
}
|
||||
if (!filesRights.copyFromPersonal) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["copy-to", "copy"]);
|
||||
}
|
||||
if (
|
||||
!filesRights.viewVersionHistory &&
|
||||
!filesRights.changeVersionHistory
|
||||
) {
|
||||
|
||||
if (!canChangeVersionFileHistory && !canViewVersionFileHistory) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["version"]);
|
||||
if (item.rootFolderType === FolderType.Archive) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["separator0"]);
|
||||
}
|
||||
}
|
||||
if (
|
||||
(!filesRights.moveSelf || !filesRights.moveAlien) &&
|
||||
!filesRights.copyFromPersonal
|
||||
) {
|
||||
|
||||
if (!canRenameItem) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["rename"]);
|
||||
}
|
||||
|
||||
if (canOpenPlayer || !canEditFile) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["edit"]);
|
||||
}
|
||||
|
||||
if (!(shouldFillForm && canFillForm)) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["fill-form"]);
|
||||
}
|
||||
|
||||
if (!canDelete) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["delete"]);
|
||||
}
|
||||
|
||||
if (!canMove) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["move-to"]);
|
||||
}
|
||||
|
||||
if (!canCopy) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["copy-to"]);
|
||||
}
|
||||
|
||||
if (!canCreateCopy) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["copy"]);
|
||||
}
|
||||
if (!canMove && !canCopy && !canCreateCopy) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["move"]);
|
||||
}
|
||||
|
||||
if (!(isMasterForm && canMakeForm))
|
||||
fileOptions = this.removeOptions(fileOptions, ["make-form"]);
|
||||
|
||||
if (item.rootFolderType === FolderType.Archive) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"make-form",
|
||||
"mark-read",
|
||||
"mark-as-favorite",
|
||||
"remove-from-favorites",
|
||||
"edit",
|
||||
"move",
|
||||
"move-to",
|
||||
"copy-to",
|
||||
"copy",
|
||||
"rename",
|
||||
"separator2",
|
||||
"delete",
|
||||
"finalize-version",
|
||||
]);
|
||||
}
|
||||
|
||||
if (!isMasterForm)
|
||||
fileOptions = this.removeOptions(fileOptions, ["make-form"]);
|
||||
|
||||
if (!shouldFillForm)
|
||||
fileOptions = this.removeOptions(fileOptions, ["fill-form"]);
|
||||
|
||||
if (!canConvert) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["download-as"]);
|
||||
}
|
||||
@ -1200,110 +1210,64 @@ class FilesStore {
|
||||
if (!canOpenPlayer) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["view"]);
|
||||
} else {
|
||||
fileOptions = this.removeOptions(fileOptions, ["edit", "preview"]);
|
||||
fileOptions = this.removeOptions(fileOptions, ["preview"]);
|
||||
}
|
||||
|
||||
if (!isDocuSign) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["docu-sign"]);
|
||||
}
|
||||
|
||||
if (isEditing) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"finalize-version",
|
||||
"move-to",
|
||||
"separator2",
|
||||
"delete",
|
||||
]);
|
||||
if (isThirdPartyItem) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["rename"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isFavorite) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["mark-as-favorite"]);
|
||||
} else {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"remove-from-favorites",
|
||||
]);
|
||||
|
||||
if (isFavoritesFolder) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["mark-as-favorite"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isFavoritesFolder) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"move-to",
|
||||
"delete",
|
||||
"copy",
|
||||
]);
|
||||
|
||||
if (!isFavorite) {
|
||||
if (
|
||||
isEditing ||
|
||||
item.rootFolderType === FolderType.Archive
|
||||
// ||
|
||||
// (isFavoritesFolder && !isFavorite) ||
|
||||
// isFavoritesFolder ||
|
||||
// isRecentFolder
|
||||
)
|
||||
fileOptions = this.removeOptions(fileOptions, ["separator2"]);
|
||||
}
|
||||
}
|
||||
|
||||
// if (isFavorite) {
|
||||
// fileOptions = this.removeOptions(fileOptions, ["mark-as-favorite"]);
|
||||
// } else {
|
||||
// fileOptions = this.removeOptions(fileOptions, [
|
||||
// "remove-from-favorites",
|
||||
// ]);
|
||||
|
||||
// if (isFavoritesFolder) {
|
||||
// fileOptions = this.removeOptions(fileOptions, ["mark-as-favorite"]);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (isEncrypted) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"open",
|
||||
"edit",
|
||||
"make-form",
|
||||
"link-for-portal-users",
|
||||
"external-link",
|
||||
// "link-for-portal-users",
|
||||
// "external-link",
|
||||
"send-by-email",
|
||||
"block-unblock-version", //need split
|
||||
"version", //category
|
||||
"finalize-version",
|
||||
"copy-to",
|
||||
"copy",
|
||||
"mark-as-favorite",
|
||||
]);
|
||||
}
|
||||
|
||||
if (isRecentFolder) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["delete"]);
|
||||
|
||||
if (!isFavorite) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["separator2"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isFavoritesFolder || isRecentFolder) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"make-form",
|
||||
"copy",
|
||||
"move-to",
|
||||
//"sharing-settings",
|
||||
"unsubscribe",
|
||||
"separator2",
|
||||
]);
|
||||
}
|
||||
// if (isFavoritesFolder || isRecentFolder) {
|
||||
// fileOptions = this.removeOptions(fileOptions, [
|
||||
// //"unsubscribe",
|
||||
// ]);
|
||||
// }
|
||||
|
||||
if (isRecycleBinFolder) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"fill-form",
|
||||
"open",
|
||||
"open-location",
|
||||
"view",
|
||||
"preview",
|
||||
"edit",
|
||||
"make-form",
|
||||
"link-for-portal-users",
|
||||
"sharing-settings",
|
||||
"external-link",
|
||||
//"link-for-portal-users",
|
||||
//"sharing-settings",
|
||||
//"external-link",
|
||||
"send-by-email",
|
||||
"block-unblock-version", //need split
|
||||
"version", //category
|
||||
"finalize-version",
|
||||
"show-version-history",
|
||||
"move", //category
|
||||
"move-to",
|
||||
"copy-to",
|
||||
"copy",
|
||||
"mark-read",
|
||||
"mark-as-favorite",
|
||||
"remove-from-favorites",
|
||||
"rename",
|
||||
// "mark-as-favorite",
|
||||
// "remove-from-favorites",
|
||||
"separator0",
|
||||
"separator1",
|
||||
]);
|
||||
@ -1327,11 +1291,7 @@ class FilesStore {
|
||||
}
|
||||
|
||||
if (isThirdPartyItem) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"owner-change",
|
||||
"finalize-version",
|
||||
"copy",
|
||||
]);
|
||||
fileOptions = this.removeOptions(fileOptions, ["owner-change"]);
|
||||
}
|
||||
|
||||
if (!hasNew) {
|
||||
@ -1340,38 +1300,42 @@ class FilesStore {
|
||||
|
||||
if (
|
||||
!(
|
||||
isRecentFolder ||
|
||||
isFavoritesFolder ||
|
||||
// isRecentFolder ||
|
||||
// isFavoritesFolder ||
|
||||
(isMyFolder && (this.filterType || this.filterSearch))
|
||||
)
|
||||
) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["open-location"]);
|
||||
}
|
||||
|
||||
if (isPrivacyFolder) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"preview",
|
||||
"view",
|
||||
"separator0",
|
||||
"copy",
|
||||
"download-as",
|
||||
]);
|
||||
// if (isPrivacyFolder) {
|
||||
// fileOptions = this.removeOptions(fileOptions, [
|
||||
// "preview",
|
||||
// "view",
|
||||
// "separator0",
|
||||
// "download-as",
|
||||
// ]);
|
||||
|
||||
if (!isDesktopClient) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
|
||||
}
|
||||
|
||||
fileOptions = this.removeOptions(
|
||||
fileOptions,
|
||||
isFileOwner ? ["unsubscribe"] : ["move-to", "delete"]
|
||||
);
|
||||
}
|
||||
// // if (!isDesktopClient) {
|
||||
// // fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
|
||||
// // }
|
||||
// }
|
||||
|
||||
fileOptions = this.removeSeparator(fileOptions);
|
||||
|
||||
return fileOptions;
|
||||
} else if (isRoom) {
|
||||
const roomAccessRights = getRoomRoleActions(item.access);
|
||||
const canInviteUserInRoom = this.accessRightsStore.canInviteUserInRoom(
|
||||
item
|
||||
);
|
||||
const canRemoveRoom = this.accessRightsStore.canRemoveRoom(item);
|
||||
|
||||
const canArchiveRoom = this.accessRightsStore.canArchiveRoom(item);
|
||||
const canPinRoom = this.accessRightsStore.canPinRoom(item);
|
||||
|
||||
const canEditRoom = this.accessRightsStore.canEditRoom(item);
|
||||
|
||||
const canViewRoomInfo = this.accessRightsStore.canViewRoomInfo(item);
|
||||
|
||||
let roomOptions = [
|
||||
"select",
|
||||
@ -1388,29 +1352,29 @@ class FilesStore {
|
||||
"delete",
|
||||
];
|
||||
|
||||
if (!roomAccessRights.edit) {
|
||||
if (!canEditRoom) {
|
||||
roomOptions = this.removeOptions(roomOptions, [
|
||||
"edit-room",
|
||||
"reconnect-storage",
|
||||
]);
|
||||
}
|
||||
|
||||
if (!roomAccessRights.inviteUsers) {
|
||||
if (!canInviteUserInRoom) {
|
||||
roomOptions = this.removeOptions(roomOptions, ["invite-users-to-room"]);
|
||||
}
|
||||
|
||||
if (!roomAccessRights.archive) {
|
||||
if (!canArchiveRoom) {
|
||||
roomOptions = this.removeOptions(roomOptions, [
|
||||
"archive-room",
|
||||
"unarchive-room",
|
||||
]);
|
||||
}
|
||||
|
||||
if (!roomAccessRights.delete) {
|
||||
if (!canRemoveRoom) {
|
||||
roomOptions = this.removeOptions(roomOptions, ["delete"]);
|
||||
}
|
||||
|
||||
if (!roomAccessRights.archive && !roomAccessRights.delete) {
|
||||
if (!canArchiveRoom && !canRemoveRoom) {
|
||||
roomOptions = this.removeOptions(roomOptions, ["separator1"]);
|
||||
}
|
||||
|
||||
@ -1418,27 +1382,28 @@ class FilesStore {
|
||||
roomOptions = this.removeOptions(roomOptions, ["reconnect-storage"]);
|
||||
}
|
||||
|
||||
if (item.pinned) {
|
||||
roomOptions = this.removeOptions(roomOptions, ["pin-room"]);
|
||||
if (!canPinRoom) {
|
||||
roomOptions = this.removeOptions(roomOptions, [
|
||||
"unpin-room",
|
||||
"pin-room",
|
||||
]);
|
||||
} else {
|
||||
roomOptions = this.removeOptions(roomOptions, ["unpin-room"]);
|
||||
item.pinned
|
||||
? (roomOptions = this.removeOptions(roomOptions, ["pin-room"]))
|
||||
: (roomOptions = this.removeOptions(roomOptions, ["unpin-room"]));
|
||||
}
|
||||
|
||||
if (!canViewRoomInfo) {
|
||||
roomOptions = this.removeOptions(roomOptions, ["room-info"]);
|
||||
}
|
||||
|
||||
if (isArchiveFolder || item.rootFolderType === FolderType.Archive) {
|
||||
roomOptions = this.removeOptions(roomOptions, [
|
||||
"edit-room",
|
||||
"invite-users-to-room",
|
||||
"pin-room",
|
||||
"unpin-room",
|
||||
"archive-room",
|
||||
"separator1",
|
||||
"room-info",
|
||||
]);
|
||||
} else {
|
||||
roomOptions = this.removeOptions(roomOptions, [
|
||||
"delete",
|
||||
"unarchive-room",
|
||||
]);
|
||||
roomOptions = this.removeOptions(roomOptions, ["unarchive-room"]);
|
||||
|
||||
if (enablePlugins) {
|
||||
const pluginRoomsKeys = getContextMenuKeysByType(
|
||||
@ -1473,66 +1438,54 @@ class FilesStore {
|
||||
"mark-read",
|
||||
"restore",
|
||||
"rename",
|
||||
"change-thirdparty-info",
|
||||
// "change-thirdparty-info",
|
||||
"separator2",
|
||||
// "unsubscribe",
|
||||
"delete",
|
||||
];
|
||||
|
||||
if (!filesRights.deleteSelf || !filesRights.deleteAlien) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["delete"]);
|
||||
}
|
||||
if (!filesRights.moveSelf || !filesRights.moveAlien) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["move-to"]);
|
||||
}
|
||||
if (!filesRights.rename) {
|
||||
if (!canRenameItem) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["rename"]);
|
||||
}
|
||||
if (!filesRights.copyFromPersonal) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["copy-to", "copy"]);
|
||||
|
||||
if (!canDelete) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["delete"]);
|
||||
}
|
||||
if (!canMove) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["move-to"]);
|
||||
}
|
||||
|
||||
if (
|
||||
(!filesRights.moveSelf || !filesRights.moveAlien) &&
|
||||
!filesRights.copyFromPersonal
|
||||
) {
|
||||
if (!canCopy) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["copy-to"]);
|
||||
}
|
||||
|
||||
if (!canCreateCopy) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["copy"]);
|
||||
}
|
||||
|
||||
if (!canMove && !canCopy && !canCreateCopy) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["move"]);
|
||||
}
|
||||
|
||||
if (item.rootFolderType === FolderType.Archive) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"move",
|
||||
"move-to",
|
||||
"copy-to",
|
||||
"rename",
|
||||
"change-thirdparty-info",
|
||||
"separator2",
|
||||
"delete",
|
||||
]);
|
||||
}
|
||||
// if (item.rootFolderType === FolderType.Archive) {
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// "change-thirdparty-info",
|
||||
// "separator2",
|
||||
// ]);
|
||||
// }
|
||||
|
||||
if (isPrivacyFolder) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"sharing-settings",
|
||||
"copy",
|
||||
"copy-to",
|
||||
]);
|
||||
|
||||
if (!isDesktopClient) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["rename"]);
|
||||
}
|
||||
}
|
||||
// if (isPrivacyFolder) {
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// // "sharing-settings",
|
||||
// ]);
|
||||
// }
|
||||
|
||||
if (isRecycleBinFolder) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"open",
|
||||
"link-for-portal-users",
|
||||
"sharing-settings",
|
||||
"move",
|
||||
"move-to",
|
||||
"copy-to",
|
||||
// "link-for-portal-users",
|
||||
// "sharing-settings",
|
||||
"mark-read",
|
||||
"rename",
|
||||
"separator0",
|
||||
"separator1",
|
||||
]);
|
||||
@ -1559,52 +1512,43 @@ class FilesStore {
|
||||
folderOptions = this.removeOptions(folderOptions, ["mark-read"]);
|
||||
}
|
||||
|
||||
if (isThirdPartyFolder) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["move-to"]);
|
||||
if (isThirdPartyFolder && isDesktopClient)
|
||||
folderOptions = this.removeOptions(folderOptions, ["separator2"]);
|
||||
|
||||
if (isDesktopClient) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"separator2",
|
||||
"delete",
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"change-thirdparty-info",
|
||||
]);
|
||||
}
|
||||
// if (!isThirdPartyFolder)
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// "change-thirdparty-info",
|
||||
// ]);
|
||||
|
||||
if (isThirdPartyItem) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["owner-change"]);
|
||||
// if (isThirdPartyItem) {
|
||||
// folderOptions = this.removeOptions(folderOptions, ["owner-change"]);
|
||||
|
||||
if (isShareFolder) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"change-thirdparty-info",
|
||||
]);
|
||||
} else {
|
||||
if (isDesktopClient) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"change-thirdparty-info",
|
||||
]);
|
||||
}
|
||||
// if (isShareFolder) {
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// "change-thirdparty-info",
|
||||
// ]);
|
||||
// } else {
|
||||
// if (isDesktopClient) {
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// "change-thirdparty-info",
|
||||
// ]);
|
||||
// }
|
||||
|
||||
folderOptions = this.removeOptions(folderOptions, ["remove"]);
|
||||
// folderOptions = this.removeOptions(folderOptions, ["remove"]);
|
||||
|
||||
if (!item) {
|
||||
//For damaged items
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"open",
|
||||
"download",
|
||||
"copy-to",
|
||||
"rename",
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"change-thirdparty-info",
|
||||
]);
|
||||
}
|
||||
// if (!item) {
|
||||
// //For damaged items
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// "open",
|
||||
// "download",
|
||||
// ]);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// folderOptions = this.removeOptions(folderOptions, [
|
||||
// "change-thirdparty-info",
|
||||
// ]);
|
||||
// }
|
||||
|
||||
if (!(isMyFolder && (this.filterType || this.filterSearch))) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["open-location"]);
|
||||
@ -2346,10 +2290,10 @@ class FilesStore {
|
||||
);
|
||||
}
|
||||
|
||||
get isThirdPartyRootSelection() {
|
||||
const withProvider = this.selection.find((x) => x.providerKey);
|
||||
return withProvider && withProvider.rootFolderId === withProvider.id;
|
||||
}
|
||||
// get isThirdPartyRootSelection() {
|
||||
// const withProvider = this.selection.find((x) => x.providerKey);
|
||||
// return withProvider && withProvider.rootFolderId === withProvider.id;
|
||||
// }
|
||||
|
||||
get isThirdPartySelection() {
|
||||
const withProvider = this.selection.find((x) => x.providerKey);
|
||||
@ -2775,11 +2719,15 @@ class FilesStore {
|
||||
}
|
||||
|
||||
get roomsForRestore() {
|
||||
return this.folders.filter((f) => getRoomRoleActions(f.access).archive);
|
||||
return this.folders.filter(
|
||||
(f) => getArchiveRoomRoleActions(f.access).restore
|
||||
);
|
||||
}
|
||||
|
||||
get roomsForDelete() {
|
||||
return this.folders.filter((f) => getRoomRoleActions(f.access).delete);
|
||||
return this.folders.filter(
|
||||
(f) => getArchiveRoomRoleActions(f.access).delete
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import { FileStatus } from "@docspace/common/constants";
|
||||
class VersionHistoryStore {
|
||||
isVisible = false;
|
||||
fileId = null;
|
||||
fileAccess = null;
|
||||
versions = null;
|
||||
filesStore = null;
|
||||
showProgressBar = false;
|
||||
@ -61,7 +62,9 @@ class VersionHistoryStore {
|
||||
setVerHistoryFileId = (fileId) => {
|
||||
this.fileId = fileId;
|
||||
};
|
||||
|
||||
setVerHistoryFileAccess = (access) => {
|
||||
this.fileAccess = access;
|
||||
};
|
||||
setVersions = (versions) => {
|
||||
this.versions = versions;
|
||||
};
|
||||
@ -90,9 +93,11 @@ class VersionHistoryStore {
|
||||
this.versions = versions;
|
||||
};
|
||||
|
||||
fetchFileVersions = (fileId) => {
|
||||
fetchFileVersions = (fileId, access) => {
|
||||
if (this.fileId !== fileId || !this.versions) {
|
||||
this.setVerHistoryFileId(fileId);
|
||||
this.setVerHistoryFileAccess(access);
|
||||
|
||||
return api.files
|
||||
.getFileVersionInfo(fileId)
|
||||
.then((versions) => this.setVerHistoryFileVersions(versions));
|
||||
|
@ -36,8 +36,6 @@ const oformsStore = new OformsStore(authStore);
|
||||
|
||||
const selectedFolderStore = new SelectedFolderStore(authStore.settingsStore);
|
||||
|
||||
const accessRightsStore = new AccessRightsStore(authStore, selectedFolderStore);
|
||||
|
||||
const paymentStore = new PaymentStore();
|
||||
const wizardStore = new WizardStore();
|
||||
const setupStore = new SettingsSetupStore();
|
||||
@ -48,6 +46,13 @@ const bannerStore = new BannerStore();
|
||||
|
||||
const ssoStore = new SsoFormStore();
|
||||
|
||||
const tagsStore = new TagsStore();
|
||||
|
||||
const treeFoldersStore = new TreeFoldersStore(selectedFolderStore);
|
||||
const settingsStore = new SettingsStore(thirdPartyStore, treeFoldersStore);
|
||||
|
||||
const accessRightsStore = new AccessRightsStore(authStore, selectedFolderStore);
|
||||
|
||||
const peopleStore = new PeopleStore(
|
||||
authStore,
|
||||
authStore.infoPanelStore,
|
||||
@ -55,11 +60,6 @@ const peopleStore = new PeopleStore(
|
||||
accessRightsStore
|
||||
);
|
||||
|
||||
const tagsStore = new TagsStore();
|
||||
|
||||
const treeFoldersStore = new TreeFoldersStore(selectedFolderStore);
|
||||
const settingsStore = new SettingsStore(thirdPartyStore, treeFoldersStore);
|
||||
|
||||
const filesStore = new FilesStore(
|
||||
authStore,
|
||||
selectedFolderStore,
|
||||
|
@ -17,6 +17,7 @@ import ArticleProfile from "./sub-components/article-profile";
|
||||
import ArticlePaymentAlert from "./sub-components/article-payment-alert";
|
||||
import { StyledArticle } from "./styled-article";
|
||||
import HideArticleMenuButton from "./sub-components/article-hide-menu-button";
|
||||
import Portal from "@docspace/components/portal";
|
||||
|
||||
const Article = ({
|
||||
showText,
|
||||
@ -107,7 +108,7 @@ const Article = ({
|
||||
[setShowText]
|
||||
);
|
||||
|
||||
return (
|
||||
const articleComponent = (
|
||||
<>
|
||||
<StyledArticle
|
||||
id={"article-container"}
|
||||
@ -158,6 +159,20 @@ const Article = ({
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
|
||||
const renderPortalArticle = () => {
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
return (
|
||||
<Portal
|
||||
element={articleComponent}
|
||||
appendTo={rootElement}
|
||||
visible={true}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return isMobileOnly ? renderPortalArticle() : articleComponent;
|
||||
};
|
||||
|
||||
Article.propTypes = {
|
||||
|
@ -1,4 +1,6 @@
|
||||
import React from "react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
import { isMobileOnly } from "react-device-detect";
|
||||
|
||||
import Loaders from "../../Loaders";
|
||||
|
||||
@ -6,6 +8,8 @@ import Backdrop from "@docspace/components/backdrop";
|
||||
import Button from "@docspace/components/button";
|
||||
import Heading from "@docspace/components/heading";
|
||||
import IconButton from "@docspace/components/icon-button";
|
||||
import Scrollbar from "@docspace/components/scrollbar";
|
||||
import Portal from "@docspace/components/portal";
|
||||
|
||||
import FilterBlockItem from "./FilterBlockItem";
|
||||
|
||||
@ -19,8 +23,6 @@ import {
|
||||
StyledControlContainer,
|
||||
StyledCrossIcon,
|
||||
} from "./StyledFilterBlock";
|
||||
import { withTranslation } from "react-i18next";
|
||||
import Scrollbar from "@docspace/components/scrollbar";
|
||||
|
||||
//TODO: fix translate
|
||||
const FilterBlock = ({
|
||||
@ -337,7 +339,7 @@ const FilterBlock = ({
|
||||
|
||||
const showFooter = isEqualFilter();
|
||||
|
||||
return (
|
||||
const filterBlockComponent = (
|
||||
<>
|
||||
{showSelector.show ? (
|
||||
<>
|
||||
@ -443,6 +445,20 @@ const FilterBlock = ({
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
const renderPortalFilterBlock = () => {
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
return (
|
||||
<Portal
|
||||
element={filterBlockComponent}
|
||||
appendTo={rootElement}
|
||||
visible={true}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return isMobileOnly ? renderPortalFilterBlock() : filterBlockComponent;
|
||||
};
|
||||
|
||||
export default React.memo(withTranslation("Common")(FilterBlock));
|
||||
|
@ -11,7 +11,8 @@ import React, { useEffect } from "react";
|
||||
import styled, { css } from "styled-components";
|
||||
import CrossIcon from "@docspace/components/public/static/images/cross.react.svg";
|
||||
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { isMobile, isMobileOnly } from "react-device-detect";
|
||||
import { Portal } from "@docspace/components";
|
||||
|
||||
const StyledInfoPanelWrapper = styled.div.attrs(({ id }) => ({
|
||||
id: id,
|
||||
@ -159,7 +160,7 @@ const InfoPanel = ({
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
const infoPanelComponent = (
|
||||
<StyledInfoPanelWrapper
|
||||
isRowView={viewAs === "row"}
|
||||
className="info-panel"
|
||||
@ -177,6 +178,20 @@ const InfoPanel = ({
|
||||
</StyledInfoPanel>
|
||||
</StyledInfoPanelWrapper>
|
||||
);
|
||||
|
||||
const renderPortalInfoPanel = () => {
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
return (
|
||||
<Portal
|
||||
element={infoPanelComponent}
|
||||
appendTo={rootElement}
|
||||
visible={isVisible}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return isMobileOnly ? renderPortalInfoPanel() : infoPanelComponent;
|
||||
};
|
||||
|
||||
InfoPanel.propTypes = {
|
||||
@ -192,7 +207,7 @@ StyledInfoPanelWrapper.defaultProps = { theme: Base };
|
||||
StyledInfoPanel.defaultProps = { theme: Base };
|
||||
InfoPanel.defaultProps = { theme: Base };
|
||||
|
||||
export default inject(({ auth, filesStore }) => {
|
||||
export default inject(({ auth }) => {
|
||||
const { isVisible, setIsVisible, getCanDisplay } = auth.infoPanelStore;
|
||||
|
||||
const canDisplay = getCanDisplay();
|
||||
|
@ -39,10 +39,10 @@ class PaymentQuotasStore {
|
||||
}
|
||||
|
||||
get tariffTitle() {
|
||||
return this.portalPaymentQuotas.title;
|
||||
return this.portalPaymentQuotas?.title;
|
||||
}
|
||||
|
||||
replaceFeaturesValues = (t) => {
|
||||
setReplacingValuesInTranslation = (t) => {
|
||||
this.replaceTotalSizeValue(t);
|
||||
};
|
||||
|
||||
|
95
packages/common/utils/actions/ArchiveFiles.js
Normal file
95
packages/common/utils/actions/ArchiveFiles.js
Normal file
@ -0,0 +1,95 @@
|
||||
export const ArchiveFilesActions = Object.freeze({
|
||||
create: false,
|
||||
load: false,
|
||||
edit: false,
|
||||
fillForm: false,
|
||||
peerReview: false,
|
||||
commenting: false,
|
||||
block: false,
|
||||
viewVersionHistory: false,
|
||||
changeVersionHistory: false,
|
||||
viewContent: false,
|
||||
viewComments: false,
|
||||
copyAtBuffer: false,
|
||||
printing: false,
|
||||
download: false,
|
||||
deleteSelf: false,
|
||||
moveSelf: false,
|
||||
deleteAlien: false,
|
||||
moveAlien: false,
|
||||
rename: false,
|
||||
copyToPersonal: false,
|
||||
saveAsForm: false,
|
||||
canCopy: false,
|
||||
canDuplicate: false,
|
||||
});
|
||||
|
||||
export const OwnerArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewVersionHistory: true,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
copyToPersonal: true,
|
||||
canCopy: true,
|
||||
});
|
||||
|
||||
export const RoomAdminArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewVersionHistory: true,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
copyToPersonal: true,
|
||||
canCopy: true,
|
||||
});
|
||||
|
||||
export const EditorArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewVersionHistory: true,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
});
|
||||
|
||||
export const FormFillerArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
});
|
||||
|
||||
export const ReviewerArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
});
|
||||
|
||||
export const CommentatorArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
});
|
||||
|
||||
export const ViewerArchiveFilesActions = Object.freeze({
|
||||
...ArchiveFilesActions,
|
||||
viewContent: true,
|
||||
viewComments: true,
|
||||
copyAtBuffer: true,
|
||||
printing: true,
|
||||
download: true,
|
||||
});
|
@ -8,6 +8,7 @@ export const ArchiveRoomsActions = Object.freeze({
|
||||
deleteUsers: false,
|
||||
restore: false,
|
||||
delete: false,
|
||||
canPin: false,
|
||||
});
|
||||
|
||||
export const OwnerArchiveRoomsActions = Object.freeze({
|
||||
|
@ -19,6 +19,9 @@ export const FilesActions = Object.freeze({
|
||||
moveAlien: false,
|
||||
rename: false,
|
||||
copyFromPersonal: false,
|
||||
saveAsForm: false,
|
||||
canCopy: false,
|
||||
canDuplicate: false,
|
||||
});
|
||||
|
||||
export const OwnerFilesActions = Object.freeze({
|
||||
@ -43,6 +46,9 @@ export const OwnerFilesActions = Object.freeze({
|
||||
moveAlien: true,
|
||||
rename: true,
|
||||
copyFromPersonal: true,
|
||||
saveAsForm: true,
|
||||
canCopy: true,
|
||||
canDuplicate: true,
|
||||
});
|
||||
|
||||
export const RoomAdminFilesActions = Object.freeze({
|
||||
@ -67,6 +73,9 @@ export const RoomAdminFilesActions = Object.freeze({
|
||||
moveAlien: true,
|
||||
rename: true,
|
||||
copyFromPersonal: true,
|
||||
saveAsForm: true,
|
||||
canCopy: true,
|
||||
canDuplicate: true,
|
||||
});
|
||||
|
||||
export const EditorFilesActions = Object.freeze({
|
||||
|
@ -8,6 +8,7 @@ export const RoomsActions = Object.freeze({
|
||||
deleteUsers: false,
|
||||
archive: false,
|
||||
delete: false,
|
||||
canPin: true,
|
||||
});
|
||||
|
||||
export const OwnerRoomsActions = Object.freeze({
|
||||
@ -20,7 +21,6 @@ export const OwnerRoomsActions = Object.freeze({
|
||||
viewInfo: true,
|
||||
deleteUsers: true,
|
||||
archive: true,
|
||||
delete: true,
|
||||
});
|
||||
|
||||
export const RoomAdminRoomsActions = Object.freeze({
|
||||
|
@ -33,6 +33,17 @@ import {
|
||||
ViewerFilesActions,
|
||||
} from "./Files";
|
||||
|
||||
import {
|
||||
ArchiveFilesActions,
|
||||
OwnerArchiveFilesActions,
|
||||
RoomAdminArchiveFilesActions,
|
||||
EditorArchiveFilesActions,
|
||||
FormFillerArchiveFilesActions,
|
||||
ReviewerArchiveFilesActions,
|
||||
CommentatorArchiveFilesActions,
|
||||
ViewerArchiveFilesActions,
|
||||
} from "./ArchiveFiles";
|
||||
|
||||
import {
|
||||
OwnerAccountsActions,
|
||||
DocSpaceAdminAccountsActions,
|
||||
@ -105,6 +116,28 @@ export const getArchiveRoomRoleActions = (access) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const getArchiveFileRoleActions = (access) => {
|
||||
switch (access) {
|
||||
case ShareAccessRights.None:
|
||||
case ShareAccessRights.FullAccess:
|
||||
return OwnerArchiveFilesActions;
|
||||
case ShareAccessRights.RoomManager:
|
||||
return RoomAdminArchiveFilesActions;
|
||||
case ShareAccessRights.Editing:
|
||||
return EditorArchiveFilesActions;
|
||||
case ShareAccessRights.FormFilling:
|
||||
return FormFillerArchiveFilesActions;
|
||||
case ShareAccessRights.Review:
|
||||
return ReviewerArchiveFilesActions;
|
||||
case ShareAccessRights.Comment:
|
||||
return CommentatorArchiveFilesActions;
|
||||
case ShareAccessRights.ReadOnly:
|
||||
return ViewerArchiveFilesActions;
|
||||
default:
|
||||
return ArchiveFilesActions;
|
||||
}
|
||||
};
|
||||
|
||||
export const getAccountsTypeActions = (isAdmin, isOwner) => {
|
||||
if (isOwner) return OwnerAccountsActions;
|
||||
|
||||
|
@ -110,9 +110,7 @@ const StyledContextMenu = styled.div`
|
||||
|
||||
.avatar-wrapper {
|
||||
min-width: 32px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
@ -120,7 +118,6 @@ const StyledContextMenu = styled.div`
|
||||
width: 100%;
|
||||
font-size: ${(props) => props.theme.menuItem.text.header.fontSize};
|
||||
font-weight: 600;
|
||||
line-height: 16px;
|
||||
${(props) =>
|
||||
props.isIconExist &&
|
||||
css`
|
||||
|
@ -26,7 +26,10 @@ import { canConvert } from "../helpers/utils";
|
||||
import { assign } from "@docspace/common/utils";
|
||||
import toastr from "@docspace/components/toast/toastr";
|
||||
import { DocumentEditor } from "@onlyoffice/document-editor-react";
|
||||
import { getFileRoleActions } from "@docspace/common/utils/actions";
|
||||
import {
|
||||
getArchiveFileRoleActions,
|
||||
getFileRoleActions,
|
||||
} from "@docspace/common/utils/actions";
|
||||
|
||||
toast.configure();
|
||||
|
||||
@ -94,13 +97,16 @@ function Editor({
|
||||
filesSettings,
|
||||
}) {
|
||||
const fileInfo = config?.file;
|
||||
|
||||
isArchiveFolderRoot =
|
||||
fileInfo && fileInfo.rootFolderType === FolderType.Archive;
|
||||
|
||||
const { t } = useTranslation(["Editor", "Common"]);
|
||||
|
||||
if (fileInfo) {
|
||||
userAccessRights = getFileRoleActions(fileInfo.access);
|
||||
userAccessRights = isArchiveFolderRoot
|
||||
? getArchiveFileRoleActions(fileInfo.access)
|
||||
: getFileRoleActions(fileInfo.access);
|
||||
}
|
||||
useEffect(() => {
|
||||
if (error && mfReady) {
|
||||
@ -532,7 +538,7 @@ function Editor({
|
||||
);
|
||||
}
|
||||
|
||||
let onRequestSharingSettings,
|
||||
let //onRequestSharingSettings,
|
||||
onRequestRename,
|
||||
onRequestSaveAs,
|
||||
onRequestInsertImage,
|
||||
@ -545,7 +551,7 @@ function Editor({
|
||||
// onRequestSharingSettings = onSDKRequestSharingSettings;
|
||||
// }
|
||||
|
||||
if (userAccessRights.rename && !isArchiveFolderRoot) {
|
||||
if (userAccessRights.rename) {
|
||||
onRequestRename = onSDKRequestRename;
|
||||
}
|
||||
|
||||
@ -563,7 +569,7 @@ function Editor({
|
||||
onRequestCompareFile = onSDKRequestCompareFile;
|
||||
}
|
||||
|
||||
if (userAccessRights.changeVersionHistory && !isArchiveFolderRoot) {
|
||||
if (userAccessRights.changeVersionHistory) {
|
||||
onRequestRestore = onSDKRequestRestore;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user