text stringlengths 1 2.83M | id stringlengths 16 152 | metadata dict | __index_level_0__ int64 0 949 |
|---|---|---|---|
{
"open_a_file_on_the_left": "Abrir un archivo a la izquierda",
"reference_error_relink_hint": "Si el error persiste, prueba a volver a vincular la cuenta aquí:",
"pdf_rendering_error": "Error al renderizar PDF",
"something_went_wrong_rendering_pdf": "Algo ha fallado al renderizar este PDF.",
"mendeley_reference_loading_error_expired": "Tu token de Mendeley ha caducado, vuelve a vincular tu cuenta",
"zotero_reference_loading_error_expired": "Tu token de Zotero ha caducado, vuelve a vincular tu cuenta",
"mendeley_reference_loading_error_forbidden": "No se han podido cargar las referencias de Mendeley, vuelve a vincular tu cuenta y prueba de nuevo",
"zotero_reference_loading_error_forbidden": "No se han podido cargar las referencias de Zotero, vuelve a vincular tu cuenta y prueba de nuevo",
"mendeley_integration": "Integración de Mendeley",
"mendeley_sync_description": "Con la integración de Mendeley puedes importar tus referencias de mendeley a tus proyectos de __appName__",
"mendeley_is_premium": "La integración de Mendeley es una característica premium",
"link_to_mendeley": "Vincular a Mendeley",
"unlink_to_mendeley": "Desvincular Mendeley",
"mendeley_reference_loading": "Cargando referencias de Mendeley",
"mendeley_reference_loading_success": "Se han cargado las referencias de Mendeley",
"mendeley_reference_loading_error": "Error, no se han podido cargar las referencias de Mendeley",
"zotero_integration": "Integración de Zotero.",
"zotero_sync_description": "Con la integración de Zotero puedes importar tus referencias de zotero a tus proyectos de __appName__.",
"zotero_is_premium": "La integración de Zotero es una característica premium",
"link_to_zotero": "Vincular a Zotero",
"unlink_to_zotero": "Desvincular Zotero",
"zotero_reference_loading": "Cargando referencias de Zotero",
"zotero_reference_loading_success": "Se han cargado las referencias de Zotero",
"zotero_reference_loading_error": "Error, no se han podido cargar las referencias de Zotero",
"reference_import_button": "Importar referencias en",
"unlink_reference": "Desvincular proveedor de referencias",
"unlink_warning_reference": "Aviso: al desvincular tu cuenta de este proveedor no podrás importar referencias en tus proyectos.",
"mendeley": "Mendeley",
"zotero": "Zotero",
"suggest_new_doc": "Sugerir nuevo documento",
"request_sent_thank_you": "Solicitud enviada, gracias.",
"suggestion": "Sugerencia",
"project_url": "URL de proyecto",
"subject": "Asunto",
"confirm": "Confirmar",
"cancel_personal_subscription_first": "Ya tienes una suscripción personal, ¿quieres que cancelemos esta primero antes de unirte a esta licencia grupal?",
"delete_projects": "Eliminar proyectos",
"leave_projects": "Abandonar proyectos",
"delete_and_leave_projects": "Eliminar y abandonar proyectos",
"too_recently_compiled": "Este proyecto se ha compilado hace muy poco, por lo que se ha omitido esta complicación.",
"clsi_maintenance": "Los servidores de compilación están fuera de servicio por mantenimiento y volverán a estar operativos muy pronto.",
"references_search_hint": "Pulsa CTRL-Espacio para buscar",
"ask_proj_owner_to_upgrade_for_references_search": "Pide al creador del proyecto que suba de categoría para usar la característica Búsqueda de referencias.",
"ask_proj_owner_to_upgrade_for_faster_compiles": "Pide al creador del proyecto que suba de categoría para compilar con mayor rapidez y aumentar el límite de tiempo.",
"search_bib_files": "Buscar por autor, título, año",
"leave_group": "Abandonar grupo",
"leave_now": "Abandonar ya",
"sure_you_want_to_leave_group": "¿Seguro que quieres abandonar este grupo?",
"notification_group_invite": "Te han invitado a unirte a __groupName__, <a href=\"/user/subscription/__subscription_id__/group/invited\">Únete aquí</a>.",
"search_references": "Buscar los archivos .bib de este proyecto",
"no_search_results": "No hay resultados de búsqueda",
"email_already_registered": "Este correo electrónico ya está registrado",
"compile_mode": "Modo de compilación",
"normal": "Normal",
"fast": "Rápido",
"rename_folder": "Renombrar carpeta",
"delete_folder": "Eliminar carpeta",
"about_to_delete_folder": "Estás a punto de eliminar las siguientes carpetas (no se eliminarán los proyectos en las mismas):",
"to_modify_your_subscription_go_to": "Para modificar tu suscripción ve a",
"manage_subscription": "Gestionar suscripción",
"activate_account": "Activar tu cuenta",
"yes_please": "¡Sí, por favor!",
"nearly_activated": "¡Estás a un solo de paso de activar tu cuenta de __appName__!",
"please_set_a_password": "Establece una contraseña",
"activation_token_expired": "Tu token de activación ha caducado, tendrás que solicitar que enviemos otro.",
"activate": "Activar",
"activating": "Activando",
"ill_take_it": "¡Sí!",
"cancel_your_subscription": "Cancelar tu suscripción",
"no_thanks_cancel_now": "No, gracias. Sigo queriendo cancelar",
"cancel_my_account": "Cancelar mi suscripción",
"sure_you_want_to_cancel": "¿Seguro que quieres cancelar?",
"i_want_to_stay": "Quiero seguir",
"have_more_days_to_try": "¡Aquí tienes <strong>__days__ días</strong> más de prueba!",
"interested_in_cheaper_plan": "¿Te interesaría el plan de estudiante más barato por <strong>__price__</strong>?",
"session_expired_redirecting_to_login": "La sesión ha caducado. Se te redirigirá a la página de inicio de sesión en __seconds__ segundos",
"maximum_files_uploaded_together": "Máximo de archivos que se pueden subir a la vez: __max__",
"too_many_files_uploaded_throttled_short_period": "Estás intentando subir demasiados archivos. Se te han limitado las subidas por un corto período de tiempo.",
"compile_larger_projects": "Compilar proyectos grandes",
"upgrade_to_get_feature": "Sube de categoría para conseguir __feature__, además de:",
"new_group": "Nuevo grupo",
"about_to_delete_groups": "Estás a punto de eliminar los siguientes grupos:",
"removing": "Eliminando",
"adding": "Añadiendo",
"groups": "Grupos",
"rename_group": "Renombrar grupo",
"renaming": "Renombrando",
"create_group": "Crear grupo",
"delete_group": "Eliminar grupo",
"delete_groups": "Eliminar grupos",
"your_groups": "Tus grupos",
"group_name": "Nombre del grupo",
"no_groups": "No hay grupos",
"Subscription": "Suscripción",
"Documentation": "Documentación",
"Universities": "Universidades",
"Account Settings": "Opciones de la cuenta",
"Projects": "Proyectos",
"Account": "Cuenta",
"global": "global",
"Terms": "Términos",
"Security": "Seguridad",
"About": "Quiénes somos",
"editor_disconected_click_to_reconnect": "Editor desconectado, clickea en cualquier parte para volver a conectar.",
"word_count": "Conteo de palabras",
"please_compile_pdf_before_word_count": "Por favor compila tu proyecto antes de realizar un conteo de palabras",
"total_words": "Palabras totales",
"headers": "Encabezados",
"math_inline": "Fórmulas en texto",
"math_display": "Fórmulas mostradas",
"connected_users": "Usuarios conectados",
"projects": "Proyectos",
"upload_project": "Subir proyecto",
"all_projects": "Todos los proyectos",
"your_projects": "Tus proyectos",
"shared_with_you": "Compartidos contigo",
"deleted_projects": "Proyectos borrados",
"templates": "Plantillas",
"new_folder": "Nueva carpeta",
"create_your_first_project": "¡Crea tu primer proyecto!",
"complete": "Completar",
"on_free_sl": "Estás usando la versión gratuita de __appName__",
"upgrade": "Sube de categoría",
"or_unlock_features_bonus": "o desbloquea gratuitamente algunas características",
"sharing_sl": "compartiendo __appName__",
"add_to_folder": "Agrega a una carpeta",
"create_new_folder": "Crear nueva carpeta",
"more": "Más",
"rename": "Renombrar",
"make_copy": "Hacer una copia",
"restore": "Restablecer",
"title": "Título",
"last_modified": "Última modificación",
"no_projects": "Sin proyectos",
"welcome_to_sl": "¡Bienvenido a __appName__!",
"new_to_latex_look_at": "¿Nuevo en LaTeX?",
"or": "o",
"or_create_project_left": "o crea tu primer proyecto a la izquierda.",
"thanks_settings_updated": "Gracias, tus opciones han sido actualizadas.",
"update_account_info": "Actualizar información de la cuenta",
"must_be_email_address": "Debe ser una dirección de correo electrónico",
"first_name": "Nombre",
"last_name": "Apellido",
"update": "Actualizar",
"change_password": "Cambiar contraseña",
"current_password": "Contraseña actual",
"new_password": "Nueva contraseña",
"confirm_new_password": "Confirmar nueva contraseña",
"required": "obligatorio",
"doesnt_match": "No concuerdan",
"dropbox_integration": "Integración con Dropbox",
"learn_more": "Más detalles",
"dropbox_is_premium": "La sincronización con Dropbox es una característica premium",
"account_is_linked": "La cuenta está conectada",
"unlink_dropbox": "Desconectar Dropbox",
"link_to_dropbox": "Conectar a Dropbox",
"newsletter_info_and_unsubscribe": "Cada pocos meses enviamos un boletín de noticias resumiendo las nuevas características disponibles. Si prefieres no recibir este correo electrónico, puedes anular la suscripción en cualquier momento:",
"unsubscribed": "Suscripción anulada",
"unsubscribing": "Anulando la suscripción",
"unsubscribe": "Anular suscripción",
"need_to_leave": "¿Necesitas dejarnos?",
"delete_your_account": "Elimina tu cuenta",
"delete_account": "Eliminar cuenta",
"delete_account_warning_message": "Estás a punto de <strong>borrar permanentemente toda tu información de la cuenta</strong>, incluyendo tus proyectos y opciones. Por favor, escribe DELETE dentro del cuadro de abajo para proceder.",
"deleting": "Eliminando",
"delete": "Eliminar",
"sl_benefits_plans": "__appName__ es el editor de LaTeX más fácil de utilizar del mundo. Mantente al día con tus colaboradores, sigue todos los cambios a tu trabajo y usa nuestro ambiente LaTeX desde cualquier parte del mundo.",
"monthly": "Mensualmente",
"personal": "Personal",
"free": "Gratis",
"one_collaborator": "Solo un colaborador",
"collaborator": "Colaborador",
"collabs_per_proj": "__collabcount__ colaboradores por proyecto",
"full_doc_history": "Historial completo de documentos",
"sync_to_dropbox": "Sincronización con Dropbox",
"start_free_trial": "¡Empieza la prueba gratuita!",
"professional": "Profesional",
"unlimited_collabs": "Colaboradores ilimitados",
"name": "Nombre",
"student": "Estudiante",
"university": "Universidad",
"position": "Cargo",
"choose_plan_works_for_you": "Elige el plan que funcione mejor para ti con nuestra prueba gratuita de __len__ días. Cancélala en cualquier momento.",
"interested_in_group_licence": "¿Interesado en usar __appName__ con un grupo, equipo o departamento?",
"get_in_touch_for_details": "¡Ponte en contacto con nostros para más detalles!",
"group_plan_enquiry": "Petición de plan grupal",
"enjoy_these_features": "Disfruta todas estas excelentes características",
"create_unlimited_projects": "Crea cuantos proyectos necesites.",
"never_loose_work": "Nunca pierdas un paso, nosotros lo traemos de vuelta.",
"access_projects_anywhere": "Accede a tus proyectos desde cualquier lugar.",
"log_in": "Ingresar",
"login": "Ingresar",
"logging_in": "Ingresando",
"forgot_your_password": "¿Olvidaste tu contraseña",
"password_reset": "Restablecer contraseña",
"password_reset_email_sent": "Se ha enviado un correo electrónico con tu contraseña restablecida.",
"please_enter_email": "Ingresa tu dirección de correo electrónico, por favor ",
"request_password_reset": "Pedir restablecimiento de contraseña",
"reset_your_password": "Restablecer tu contraseña",
"password_has_been_reset": "Tu contraseña ha sido restablecida",
"login_here": "Ingresa aquí",
"set_new_password": "Establece una nueva contraseña",
"user_wants_you_to_see_project": "__username__ quiere que veas __projectname__",
"join_sl_to_view_project": "Ingresa a __appName__ para ver este proyecto",
"register_to_edit_template": "Por favor regístrate para editar la plantilla __templateName__",
"already_have_sl_account": "¿Ya tienes una cuenta de __appName__?",
"register": "Registrarse",
"password": "Contraseña",
"registering": "Registrando",
"planned_maintenance": "Mantenimiento programado",
"no_planned_maintenance": "No hay mantenimiento programado actualmente",
"cant_find_page": "Disculpa, no podemos encontrar la página que estás buscando.",
"take_me_home": "¡Llévame al incio!",
"no_preview_available": "Disculpa, no hay previsualización.",
"no_messages": "Sin mensajes",
"send_first_message": "Envía tu primer mensaje",
"account_not_linked_to_dropbox": "Tu cuenta no está conectada con Dropbox",
"update_dropbox_settings": "Actualizar opciones de Dropbox",
"refresh_page_after_starting_free_trial": "Por favor actualiza esta página para empezar tu prueba gratuita.",
"checking_dropbox_status": "revisando estado de Dropbox",
"dismiss": "Descartar",
"deleted_files": "Archivos borrados",
"new_file": "Archivo nuevo",
"upload_file": "Subir archivo",
"create": "Crear",
"creating": "Creando",
"upload_files": "Subir archivo(s)",
"sure_you_want_to_delete": "¿Seguro que quieres borrar permanentemente los siguientes archivos?",
"common": "Común",
"navigation": "Navegación",
"editing": "Editando",
"ok": "Aceptar",
"source": "Fuente",
"actions": "Acciones",
"copy_project": "Copiar proyecto",
"publish_as_template": "Publicar como plantilla",
"sync": "Sincronizar",
"settings": "Opciones",
"main_document": "Documento principal",
"off": "Apagado",
"auto_complete": "Autocompletar",
"theme": "Tema",
"font_size": "Tamaño de la tipografía",
"pdf_viewer": "Visor de PDF",
"built_in": "Integrado",
"native": "nativo",
"show_hotkeys": "Mostrar teclas de acceso rápido",
"new_name": "Nuevo nombre",
"copying": "copiando",
"copy": "Copiar",
"compiling": "Compilando",
"click_here_to_preview_pdf": "Clickea aquí para previsualizar tu trabajo como un PDF.",
"server_error": "Error del servidor",
"somthing_went_wrong_compiling": "Disculpa, algo anduvo mal y tu proyecto no se pudo compilar. Por favor, intenta de nuevo en unos minutos más.",
"timedout": "Expiró el tiempo de espera",
"proj_timed_out_reason": "Disculpa, tu compilación tomó mucho tiempo en completarse y falló. Esto puede ser debido a un gran número de imágenes de alta resolución o diagramas muy complicados.",
"no_errors_good_job": "Sin errores, ¡buen trabajo!",
"compile_error": "Error de compilación",
"generic_failed_compile_message": "Disculpa, tu código LaTeX no se pudo compilar por alguna razón. Por favor revisa los errores de abajo para detalles o mira el log completo",
"other_logs_and_files": "Otros logs y archivos",
"view_raw_logs": "Ver logs completos",
"hide_raw_logs": "Esconder logs completos",
"clear_cache": "Borrar caché",
"clear_cache_explanation": "Esto limpiará todos los archivos LaTeX escondidos (.aux, .bbl, etc.) de tu servidor de compilación. Generalmente no necesitas hacer eso a menos que estés teniendo problemas con las referencias.",
"clear_cache_is_safe": "Tus archivos del proyecto no serán borrados ni cambiados.",
"clearing": "Limpiando",
"template_description": "Descripción de plantilla",
"project_last_published_at": "Tu proyecto fue publicado en",
"problem_talking_to_publishing_service": "Hay un problema con nuestro servicio de publicación, por favor intenta en unos minutos más",
"unpublishing": "Anular publicación",
"republish": "Volver a publicar",
"publishing": "Publicando",
"share_project": "Compartir proyecto",
"this_project_is_private": "Este proyecto es privado y es solamente accesible por las personas de abajo.",
"make_public": "Hacer público",
"this_project_is_public": "Este proyecto es público y puede ser editado por cualquiera que tenga la URL.",
"make_private": "Hacer privado",
"can_edit": "Puede editar",
"share_with_your_collabs": "Compartir con tus colaboradores",
"share": "Compartir",
"need_to_upgrade_for_more_collabs": "Necesitas subir de categoría tu cuenta para añadir más colaboradores",
"make_project_public": "Hacer público este proyecto",
"make_project_public_consequences": "Si haces público tu proyecto, cualquiera que tenga la URL podrá acceder a él.",
"allow_public_editing": "Permitir edición pública",
"allow_public_read_only": "Permitir solo acceso público de lectura",
"make_project_private": "Hacer proyecto privado",
"make_project_private_consequences": "Si hacer tu proyecto privado, solo las personas a las que tú elijas compartir tendrán acceso a él.",
"need_to_upgrade_for_history": "Necesitas subir de categoría tu cuenta para usar la característica Historial.",
"ask_proj_owner_to_upgrade_for_history": "Por favor pregúntale al dueño del proyecto para subir de categoría para usar la característica Historial.",
"anonymous": "Anónimo",
"generic_something_went_wrong": "Disculpa, algo falló :(",
"restoring": "Restableciendo",
"restore_to_before_these_changes": "Restablecer antes de hacer los cambios",
"profile_complete_percentage": "Tu perfil está __percentval__% completo",
"file_has_been_deleted": "__filename__ ha sido eliminado",
"sure_you_want_to_restore_before": "¿Estás seguro que quieres restablecer <0>__filename__</0> antes de los cambios en __date__?",
"rename_project": "Renombrar proyecto",
"about_to_delete_projects": "Estás a punto de eliminar los siguientes proyectos:",
"about_to_leave_projects": "Estás apunto de abandonar los siguientes proyectos:",
"upload_zipped_project": "Subir proyecto en Zip",
"upload_a_zipped_project": "Subir un proyecto en Zip",
"your_profile": "Tu pergil",
"institution": "Institución",
"role": "Rol",
"folders": "Carpetas",
"disconnected": "Desconectado",
"please_refresh": "Por favor actualiza la página para continuar.",
"lost_connection": "Conexión perdida",
"reconnecting_in_x_secs": "Volviendo a conectar en __seconds__ segundos",
"try_now": "Intenta ahora",
"reconnecting": "Volviendo a conectar",
"saving_notification_with_seconds": "Guardando __docname__... (__seconds__ segundos de cambios no guardados)",
"help_us_spread_word": "Ayúdanos a difundir __appName__",
"share_sl_to_get_rewards": "Comparte __appName__ con tus amigos y colegas y desbloquea los siguientes beneficios",
"post_on_facebook": "Postea en Facebook",
"share_us_on_googleplus": "Compártelo en Google+",
"email_us_to_your_friends": "Envía un correo electrónico a tus amigos",
"link_to_us": "Enlázanos desde tu sitio web",
"direct_link": "Enlace directo",
"sl_gives_you_free_stuff_see_progress_below": "Cuando alguien empieza a usar __appName__ después de tu recomendación, ¡te daremos <strong>beneficios gratuitos</strong> para agradecerte! Revisa tu progreso abajo.",
"spread_the_word_and_fill_bar": "Corre la voz y llena esta barra",
"one_free_collab": "Un colaborador gratis",
"three_free_collab": "Tres colaboradores gratis",
"free_dropbox_and_history": "Dropbox e historial gratis",
"you_not_introed_anyone_to_sl": "Todavía no has logrado que alguien use __appName__. ¡Sigue compartiendo!",
"you_introed_small_number": " Has hecho usar __appName__ a <0>__numberOfPeople__</0> personas. Buen trabajo, pero ¿puedes un poco más?",
"you_introed_high_number": " Has hecho usar __appName__ a <0>__numberOfPeople__</0> personas. ¡Buen trabajo!",
"link_to_sl": "Enlace a __appName__",
"can_link_to_sl_with_html": "Puedes enlazar a __appName__ con el siguiente código HTML:",
"year": "año",
"month": "mes",
"subscribe_to_this_plan": "Suscríbete a este plan",
"your_plan": "Tu plan",
"your_subscription": "Tu suscripción",
"on_free_trial_expiring_at": "Actualmente estás ocupando la prueba gratuita que expira el __expiresAt__.",
"choose_a_plan_below": "Elige un plan de abajo para suscribirte.",
"currently_subscribed_to_plan": "Actualmente estás suscrito al plan <0>__planName__</0>.",
"change_plan": "Cambiar plan",
"next_payment_of_x_collectected_on_y": "El próximo pago de <0>__paymentAmmount__</0> será cobrado el <1>__collectionDate__</1>",
"update_your_billing_details": "Actualiza tus detalles para cobro",
"subscription_canceled_and_terminate_on_x": " Tu suscripción ha sido cancelada y terminará el <0>__terminateDate__</0>. No se realizarán futuros pagos.",
"your_subscription_has_expired": "Tu suscripción expiró.",
"create_new_subscription": "Crear nueva suscripción",
"problem_with_subscription_contact_us": "Hay un problema con tu suscripción. Por favor toma contacto con nosotros para mayor infor\u001bmación.",
"manage_group": "Administrar grupo",
"loading_billing_form": "Cargando formulario de detalles de pago",
"you_have_added_x_of_group_size_y": "Has agregado <0>__addedUsersSize__</0> de <1>__groupSize__</1> miembros disponibles",
"remove_from_group": "Eliminar del grupo",
"group_account": "Cuenta grupal",
"registered": "Registrado",
"no_members": "Sin miembros",
"add_more_members": "Agregar más miembros",
"add": "Agregar",
"thanks_for_subscribing": "¡Gracias por suscribirte!",
"your_card_will_be_charged_soon": "Pronto se cobrará en tu tarjeta.",
"if_you_dont_want_to_be_charged": "Si no quieres que te cobremos de nuevo ",
"add_your_first_group_member_now": "Agrega tu primer grupo de miembros ahora",
"thanks_for_subscribing_you_help_sl": "Gracias por suscribirte al plan __planName__. Es por personas como tú que permite que __appName__ siga creciendo y mejorando.",
"back_to_your_projects": "Volver a tus proyectos",
"goes_straight_to_our_inboxes": "Va directo a nuestras dos bandejas de entrada",
"need_anything_contact_us_at": "Si hay algo que necesitas, no dudes en contactarnos directamente en",
"regards": "Atentamente",
"about": "Quiénes somos",
"comment": "Comentar",
"restricted_no_permission": "Restringido. Disculpa, no tienes permiso para cargar esta página.",
"online_latex_editor": "Editor de LaTeX online",
"meet_team_behind_latex_editor": "Conoce al equipo detrás de tu editor online de LaTeX favorito.",
"follow_me_on_twitter": "Síguenos en Twitter",
"motivation": "Motivación",
"evolved": "Evolucionado",
"the_easy_online_collab_latex_editor": "El editor de LaTeX fácil de usar, online y colaborativo",
"get_started_now": "Comienza ahora",
"sl_used_over_x_people_at": "__appName__ es usado por más de __numberOfUsers__ estudiantes y académicos en:",
"collaboration": "Colaboración",
"work_on_single_version": "Trabajen juntos en una sola versión",
"view_collab_edits": "Ver ediciones de los colaboradores ",
"ease_of_use": " Facilidad de uso",
"no_complicated_latex_install": "Sin instalaciones complicadas de LaTeX",
"all_packages_and_templates": "Todos los paquetes y <0>__templatesLink__</0> que necesitas",
"document_history": "Historial del documento",
"see_what_has_been": "Mira qué ha sido ",
"added": "agregado",
"and": "y",
"removed": "eliminado",
"restore_to_any_older_version": "Restaura cualquier versión anterior",
"work_from_anywhere": "Trabaja desde cualquier lugar",
"acces_work_from_anywhere": "Accede a tu trabajo desde cualquier parte del mundo",
"work_offline_and_sync_with_dropbox": "Trabaja offline y sincroniza tus archivos a través de Dropbox y GitHub",
"over": "más",
"view_templates": "Ver plantillas",
"nothing_to_install_ready_to_go": "No hay nada complejo ni difícil que tengas que instalar, y puedes <0>__start_now__</0>, incluso si nunca lo has visto antes. __appName__ viene con un ambiente LaTeX completo y listo para usar que se ejecuta en nuestros servidores.",
"start_using_latex_now": "comenzar a usar LaTeX ahora",
"get_same_latex_setup": "Con __appName__ obtienes la misma configuración donde quiera que estés. Trabajando con tus colegas y estudiantes en __appName__, sabes que no te conducirá a inconsistencia de versiones o conflictos de paquetes.",
"support_lots_of_features": "Soportamos casi todas las características de LaTeX, incluyendo inserción de imágenes, bibliografías, ecuaciones ¡y mucho más! Lee sobre todas las emocionantes cosas que puedes hacer con __appName__ en nuestras <0>__help_guides_link__</0>",
"latex_guides": "Guías de LaTeX",
"reset_password": "Restablecer contraseña",
"set_password": "Establecer contraseña",
"updating_site": "Actualizando sitio",
"bonus_please_recommend_us": "Bono - Recomiéndanos, por favor",
"admin": "administrador",
"subscribe": "Suscríbete",
"update_billing_details": "Actualizar detalles de pago",
"group_admin": "Grupo de administración",
"all_templates": "Todas las plantillas",
"your_settings": "Tus opciones",
"maintenance": "Mantenimiento",
"to_many_login_requests_2_mins": "Esta cuenta ha tenido muchas peticiones de identificación. Por favor espera 2 minutos antes de intentar identificarte de nuevo",
"email_or_password_wrong_try_again": "Tu correo electrónico o contraseña es incorrecto.",
"rate_limit_hit_wait": "Límite de intentos alcanzado. Por favor espera un momento antes de reintentar",
"problem_changing_email_address": "Hubo un problema cambiando tu dirección de correo electrónico. Por favor intenta de nuevo en unos minutos. Si tu problema persiste, contáctanos por favor.",
"single_version_easy_collab_blurb": "__appName__ asegura que estás siempre actualizado con tus colaboradores y lo qué están haciendo. Hay solo una versión de cada documento al que todos tienen acceso. Es imposible hacer cambios que produzcan conflictos, y no tienes que esperar a que tus colegas te envíen el último borrador antes de que puedas seguir trabajando.",
"can_see_collabs_type_blurb": "Si múltiples personas quieren trabajar en un documento al mismo tiempo, no hay problema. Puedes ver dónde están escribiendo tus colegas directamente en el editor, y los cambios se muestran inmediatamente en tu pantalla.",
"work_directly_with_collabs": "Trabaja directamente con tus colaboradores",
"work_with_word_users": "Trabaja con usuarios de Word",
"work_with_word_users_blurb": "Es tán fácil empezar con __appName__ que podrás invitar a colegas que no usen LaTeX para que contribuyan directamente en tus documentos LaTeX. Serán productivos desde el primer día y podrán editar pequeñas partes de LaTeX mientras se inicien.",
"view_which_changes": "Ver qué cambios han ocurrido",
"sl_included_history_of_changes_blurb": "__appName__ incluye un historial de todos los cambios, para que así puedas ver exactamente qué se ha cambiado y cuándo. Esto hace extremadamente fácil mantenerse al día con cualquier progreso hecho por tus colaboradores y te permite ver trabajo reciente.",
"can_revert_back_blurb": "Trabajando solo o con colaboradores, a veces se cometen errores. Revirtiendo los cambios a versiones previas es simple y elimina el riesgo de perder trabajo o lamentar un cambio.",
"start_using_sl_now": "Comienza a usar __appName__ ahora",
"over_x_templates_easy_getting_started": "Hay __over__ de 400 __templates__ en nuestra galería de plantillas, así que es bastante fácil empezar, ya sea que estés escribiendo un artículo científico, una tesis, un CV u otro.",
"done": "Listo",
"change": "Cambiar",
"page_not_found": "Página no encontrada",
"please_see_help_for_more_info": "Por favor ve nuestra guía para mayor información",
"this_project_will_appear_in_your_dropbox_folder_at": "Este proyecto aparecerá en tu carpeta de Dropbox en ",
"member_of_group_subscription": "Eres miembro de un grupo de suscripción administrado por __admin_email__. Por favor contáctanos para administrar tu suscripción. \n",
"about_henry_oswald": "es un ingeniero de software que vive en Londres. Construyó el prototipo original de __appName__ y ha sido responsable de construir una plataforma estable y escalable. Henry es un fuerte defendor del Desarrollo guiado por pruebas y asegura que mantengamos el código de __appName__ limpio y fácil de mantener.",
"about_james_allen": "tiene un doctorado en física teórica y es apasionado sobre LaTeX. Creó uno de los primeros editores de LaTeX online, ScribTeX, y ha jugado un gran rol desarrollando tecnologías que hacen __appName__ posible.",
"two_strong_principles_behind_sl": "Hay dos fuerte principios que nos guían en nuestro trabajo en __appName__:",
"want_to_improve_workflow_of_as_many_people_as_possible": "Queremos mejorar el flujo de trabajo de tantas personas como sea posible.",
"detail_on_improve_peoples_workflow": "LaTeX es notoriamente difícil de usar, y la colaboración siempre es difícil de coordinar. Creemos que hemos desarrollado algunas buenas soluciones para ayudar a las personas que enfrentan estos problemas, y queremos asegurar que __appName__ sea accesible a tantas personas como sea posible. Hemos intentado mantener un precio justo y hemos liberado la mayor parte del código de __appName__ como código abierto, de manera tal que cualquier persona puesta montar su propia versión en su servidor.",
"want_to_create_sustainable_lasting_legacy": "Queremos crear un legado sustentable y duraredo.",
"details_on_legacy": "El desarrollo y mantención de un producto como __appName__ toma mucho tiempo y trabajo, así que es importante que podamos encontrar un modelo de negocios que mantenga esto tanto ahora como en el largo plazo. No queremos que __appName__ sea dependiente de un financiador externo o desaparezca debido a un fallo en el modelo de negocios. Me complace decir que actualmente estamos en condiciones de llevar __appName__ de manera rentable y sustentable, y esperamos hacerlo en el largo plazo.",
"get_in_touch": "Ponte en contacto",
"want_to_hear_from_you_email_us_at": "Apreciamos la opinión de cualquier persona que use __appName__, o quiera conversar sobre lo que estamos haciendo. Puedes contactarte con nosotros en ",
"cant_find_email": "Ese correo electrónico no está registrado, disculpa.",
"plans_amper_pricing": "Planes y precios",
"documentation": "Documentación",
"account": "Cuenta",
"subscription": "Suscripción",
"log_out": "Cerrar sesión",
"en": "Inglés",
"pt": "Portugués",
"es": "Español",
"fr": "Francés",
"de": "Alemán",
"it": "Italiano",
"da": "Danés",
"sv": "Sueco",
"no": "Noruego",
"nl": "Neerlandés",
"pl": "Polaco",
"ru": "Ruso",
"uk": "Ucraniano",
"ro": "Rumano",
"click_here_to_view_sl_in_lng": "Clickea aquí para usar __appName__ en <0>__lngName__</0>",
"language": "Idioma",
"upload": "Subir",
"menu": "Menú",
"full_screen": "Pantalla completa",
"logs_and_output_files": "Logs y archivos de salida",
"download_pdf": "Descargar PDF",
"split_screen": "Dividir pantalla",
"clear_cached_files": "Borrar archivos en la caché",
"go_to_code_location_in_pdf": "Ir a la ubicación del código en el PDF",
"please_compile_pdf_before_download": "Por favor compila tu proyecto antes de descargar el PDF",
"remove_collaborator": "Eliminar colaborador(a)",
"add_to_folders": "Agregar a carpetas",
"download_zip_file": "Descargar archivo .zip",
"price": "Precio",
"close": "Cerrar",
"keybindings": "Teclas asociadas",
"restricted": "Restringido",
"start_x_day_trial": "¡Empieza hoy tu prueba gratis por __len__ días!",
"buy_now": "¡Comprar ahora!",
"cs": "Checo",
"view_all": "Ver todas",
"terms": "Términos",
"privacy": "Privacidad",
"contact": "Contacto",
"change_to_this_plan": "Cambiar a este plan",
"processing": "procesando",
"sure_you_want_to_change_plan": "¿Estás seguro que quieres cambiar al plan <0>__planName__</0>_?",
"move_to_annual_billing": "Cambiar a facturación anual",
"annual_billing_enabled": "Facturación anual habilitada",
"move_to_annual_billing_now": "Cambiar ahora a facturación anual",
"change_to_annual_billing_and_save": "Consigue un <0>__percentage__</0> de descuento con facturación anual. Si cambias ahora, ahorrarás <1>__yearlySaving__</1> cada año.",
"missing_template_question": "¿Falta una plantilla?",
"tell_us_about_the_template": "Si estamos olvidando una plantilla, por favor: Envíanos una copia de la plantilla, una dirección url de la plantilla en __appName__ o dinos dónde podemos encontrar la plantilla. Además, cuéntanos un poco sobre la plantilla para su descripción, por favor.",
"email_us": "Envíanos un correo electrónico",
"this_project_is_public_read_only": "Este proyecto es público y puede ser visto (pero no editado) por cualquiera que tenga la dirección URL",
"tr": "Turco",
"select_files": "Seleccionar archivo(s)",
"drag_files": "arrastrar archivo(s)",
"upload_failed_sorry": "Falló la subida, disculpa :(",
"inserting_files": "Insertando archivo...",
"password_reset_token_expired": "Tu token de reinicio de contraseña ha expirado. Por favor solicita un nuevo correo electrónico para reinicio de contraseña y sigue el enlace ahí.",
"merge_project_with_github": "Une el proyecto con GitHub",
"pull_github_changes_into_sharelatex": "Actualiza cambios de GitHub en __appName__",
"push_sharelatex_changes_to_github": "Envía cambios de __appName__ a GitHub",
"features": "Características",
"commit": "Commit",
"commiting": "Commiting",
"importing_and_merging_changes_in_github": "Importando y uniendo cambios en GitHub",
"upgrade_for_faster_compiles": "Sube de categoría para compilaciones más rápidas e incrementar tu tiempo de espera límite",
"free_accounts_have_timeout_upgrade_to_increase": "Las cuentas gratis tienen un tiempo de espera de un minuto. Sube de categoría para incrementar tu tiempo de espera límite.",
"learn_how_to_make_documents_compile_quickly": "Aprende a hacer la compilación de tu documento más rápida",
"zh-CN": "Chino",
"cn": "Chino (simplificado)",
"sync_to_github": "Sincronizar con GitHub",
"sync_to_dropbox_and_github": "Sincroniza con Dropbox y GitHub",
"project_too_large": "Proyecto demasiado grande",
"project_too_large_please_reduce": "Este proyecto tiene mucho texto, por favor intenta reducirlo.",
"please_ask_the_project_owner_to_link_to_github": "Por favor solicita al dueño del proyecto enlazar este proyecto a un repositorio en GitHub",
"go_to_pdf_location_in_code": "Ir a la ubicación del PDF en el código",
"ko": "Coreano",
"ja": "Japonés",
"about_brian_gough": "es un desarrollador de software y ex físico teórico de partículas en Fermilab y Los Alamos. Por muchos años ha publicado manuales de software usando TeX y LaTeX, y también fue mantenedor de la biblioteca científica GNU.",
"first_few_days_free": "Primeros __trialLen__ días gratis",
"every": "cada",
"credit_card": "Tarjeta de crédito",
"credit_card_number": "Número de tarjeta de crédito",
"invalid": "Inválida",
"expiry": "Fecha de expiración",
"january": "Enero",
"february": "Febrero",
"march": "Marzo",
"april": "Abril",
"may": "Mayo",
"june": "Junio",
"july": "Julio",
"august": "Agosto",
"september": "Septiembre",
"october": "Octubre",
"november": "Noviembre",
"december": "Diciembre",
"zip_post_code": "Código postal",
"city": "Ciudad",
"address": "Dirección",
"coupon_code": "código de cupón",
"country": "País",
"billing_address": "Dirección para cobranza",
"upgrade_now": "Sube de categoría ahora",
"state": "Estado",
"vat_number": "Número VAT",
"you_have_joined": "Te has unido a __groupName__",
"claim_premium_account": "Has reclamdo tu cuenta premium otorgada por __groupName__.",
"you_are_invited_to_group": "Te han invitado a unirte a __groupName__",
"you_can_claim_premium_account": "Puedes pedir una cuenta premium otorgada por __groupName__ verificando tu correo electrónico",
"not_now": "Ahora no",
"verify_email_join_group": "Verificar correo electrónico e ingresar a grupo",
"check_email_to_complete_group": "Por favor revisa tu correo electrónico para completar el ingreso al grupo",
"verify_email_address": "Verificar correo electrónico",
"group_provides_you_with_premium_account": "__groupName__ te otorga una cuenta premium. Verifica tu dirección de correo electrónico para subir de nivel tu cuenta.",
"check_email_to_complete_the_upgrade": "Por favor revisa tu correo electrónico para completar el cambio",
"email_link_expired": "El link para el correo electrónico expiró, por favor solicita uno nuevo.",
"services": "Servicios",
"about_shane_kilkelly": "es un desarrollador de software que vive en Edimburgo. Shane es un fuerte adherente de la programación funcional, desarrollo dirigido por pruebas y se enorgullece de construir software de calidad.",
"this_is_your_template": "Esta es la plantilla de tu proyecto",
"links": "Enlaces",
"account_settings": "Opciones de la cuenta",
"search_projects": "Buscar proyectos",
"clone_project": "Clonar proyecto",
"delete_project": "Eliminar proyecto",
"download_zip": "Descargar Zip",
"new_project": "Nuevo proyecto",
"blank_project": "Proyecto vacío",
"example_project": "Proyecto de ejemplo",
"from_template": "Desde plantilla",
"cv_or_resume": "Currículum Vitae",
"cover_letter": "Carta de presentación",
"journal_article": "Artículo para journal",
"presentation": "Presentación",
"thesis": "Tesis",
"bibliographies": "Bibliografías",
"terms_of_service": "Términos de servicio",
"privacy_policy": "Política de privacidad",
"plans_and_pricing": "Planes y precios",
"university_licences": "Licencias para universidades",
"security": "Seguridad",
"contact_us": "Contáctanos",
"thanks": "¡Gracias",
"blog": "Blog",
"latex_editor": "Editor LaTeX",
"get_free_stuff": "Obtén beneficios gratis",
"chat": "Chat",
"your_message": "Tu mensaje",
"loading": "Cargando",
"connecting": "Conectando",
"recompile": "Recompilar",
"download": "Descargar",
"email": "Email",
"owner": "Propietario",
"read_and_write": "Leer y escribir",
"read_only": "Solo leer",
"publish": "Publicar",
"view_in_template_gallery": "Verlo en la galería de plantillas",
"description": "Descripción",
"unpublish": "Anular publicación",
"hotkeys": "Teclas de acceso rápido",
"saving": "Guardando",
"cancel": "Cancelar",
"project_name": "Nombre del proyecto",
"root_document": "Documento raíz",
"spell_check": "Revisión de ortografía",
"compiler": "Compilador",
"private": "Privado",
"public": "Público",
"delete_forever": "Eliminar para siempre",
"support_and_feedback": "Soporte y feedback",
"help": "Ayuda",
"latex_templates": "Plantillas LaTeX",
"info": "Información",
"latex_help_guide": "Guía de ayuda de LaTeX",
"choose_your_plan": "Elige tu plan",
"indvidual_plans": "Planes individuales",
"free_forever": "Gratis para siempre",
"low_priority_compile": "Baja prioridad en compilación",
"unlimited_projects": "Proyectos ilimitados",
"unlimited_compiles": "Compilaciones ilimitadas",
"full_history_of_changes": "Historial completo de cambios",
"highest_priority_compiling": "Prioridad de compilación más alta",
"dropbox_sync": "Sincronización con Dropbox",
"beta": "Beta",
"sign_up_now": "¡Regístrate ahora",
"annual": "Anual",
"half_price_student": "Planes de estudiantes a mitad de precio",
"about_us": "Quiénes somos",
"loading_recent_github_commits": "Cargando commits recientes",
"no_new_commits_in_github": "No hay nuevos commits en GitHub desde el último merge.",
"dropbox_sync_description": "Mantén tus proyectos de __appName__ sincronizados con Dropbox. Los cambios en __appName__ son automáticamente enviados a tu Dropbox y vice versa.",
"github_sync_description": "Con la sincronización con GitHub puedes enlazar tus proyectos de __appName__ con repositorios GitHub. Crea nuevos commits desde __appName__ y únelos con commits hechos offline o en GitHub.",
"github_import_description": "Con la sincronización con GitHub puedes importar tus repositorios de GitHub en __appName__. Crea nuevos commits desde __appName__ y únelos con commits hechos offline o en GitHub.",
"link_to_github_description": "Necesitas autorizar a __appName__ para acceder a tu cuenta de GitHub para permitirnos sincronizar tus proyectos.",
"unlink": "Desvincular",
"unlink_github_warning": "Cualquier proyecto que hayas sincronizado con GitHub será desconectado y no se mantendrá sincronizado con GitHub. ¿Estás seguro que quieres desvincular tu cuenta de GitHub?",
"github_account_successfully_linked": "¡Cuenta de GitHub vinculada satisfactoriamente!",
"github_successfully_linked_description": "Gracias, vinculamos exitosamente tu cuenta de GitHub con __appName__. Ahora puedes exportar tus proyectos de __appName__ a GitHub o importar proyectos desde tus repositorios en GitHub.",
"import_from_github": "Importar desde GitHub",
"github_sync_error": "Disculpa, hubo un error en la conexión con nuestro servicio de GitHub. Intenta de nuevo en unos minutos más, por favor.",
"loading_github_repositories": "Cargando tus repositorios de GitHub",
"select_github_repository": "Selecciona un repositorio de GitHub para importarlo en __appName__",
"import_to_sharelatex": "Importa a __appName__",
"importing": "Importando",
"github_sync": "Sincronización con GitHub",
"checking_project_github_status": "Revisando estado de proyecto en GitHub",
"account_not_linked_to_github": "Tu cuenta no está enlazada con GitHub",
"project_not_linked_to_github": "Este proyecto no está enlazado a un repositorio de GitHub. Puedes crear un repositorio para él en GitHub:",
"create_project_in_github": "Crear un repositorio en GitHub",
"project_synced_with_git_repo_at": "Este proyecto está sincronizado con el repositorio de GitHub en",
"recent_commits_in_github": "Commits recientes en GitHub",
"sync_project_to_github": "Sincronizar proyecto con GitHub",
"sync_project_to_github_explanation": "Cualquier cambio que hagas en __appName__ será guardado como un commit y merge con cualquier actualización en GitHub.",
"github_merge_failed": "Tus cambios en __appName__ y GitHub podrían no ser automáticamente unidos. Por favor, une (merge) la rama <0>__sharelatex_branch__</0> en la rama <1>__master_branch__</1> a través de git. Clickea abajo para continuar, después de que hayas hecho el merge manual.",
"continue_github_merge": "He hecho el merge de forma manual. Continuar",
"export_project_to_github": "Exportar proyecto a GitHub",
"github_validation_check": "Por favor revisa que el nombre del repositorio es válido y que tienes permisos para crear el repositorio.",
"repository_name": "Nombre del repositorio",
"optional": "Opcional",
"github_public_description": "Cualquier persona puede ver este repositorio. Tú eliges quién puede contribuir.",
"github_commit_message_placeholder": "Mensaje del commit para cambios hechos en __appName__...",
"merge": "Merge",
"merging": "Merging",
"github_account_is_linked": "Tu cuenta de GitHub fue enlazada exitosamente.",
"unlink_github": "Desvincula tu cuenta de GitHub",
"link_to_github": "Enlace a tu cuenta de GitHub",
"github_integration": "Integración con GitHub",
"github_is_premium": "La sincronización con GitHub es una característica premium",
"thank_you": "Gracias"
}
| overleaf/web/locales/es.json/0 | {
"file_path": "overleaf/web/locales/es.json",
"repo_id": "overleaf",
"token_count": 16317
} | 600 |
/* eslint-disable no-unused-vars */
const Helpers = require('./lib/helpers')
exports.tags = ['server-ce', 'server-pro', 'saas']
const indexes = [
{
unique: true,
key: {
user_id: 1,
},
name: 'user_id_1',
},
]
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.contacts, indexes)
}
exports.rollback = async client => {
const { db } = client
try {
await Helpers.dropIndexesFromCollection(db.contacts, indexes)
} catch (err) {
console.error('Something went wrong rolling back the migrations', err)
}
}
| overleaf/web/migrations/20190912145001_create_contacts_indexes.js/0 | {
"file_path": "overleaf/web/migrations/20190912145001_create_contacts_indexes.js",
"repo_id": "overleaf",
"token_count": 228
} | 601 |
/* eslint-disable no-unused-vars */
const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const indexes = [
{
unique: true,
key: {
authorizationCode: 1,
},
name: 'authorizationCode_1',
},
]
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.oauthAuthorizationCodes, indexes)
}
exports.rollback = async client => {
const { db } = client
try {
await Helpers.dropIndexesFromCollection(db.oauthAuthorizationCodes, indexes)
} catch (err) {
console.error('Something went wrong rolling back the migrations', err)
}
}
| overleaf/web/migrations/20190912145017_create_oauthAuthorizationCodes_indexes.js/0 | {
"file_path": "overleaf/web/migrations/20190912145017_create_oauthAuthorizationCodes_indexes.js",
"repo_id": "overleaf",
"token_count": 225
} | 602 |
/* eslint-disable no-unused-vars */
const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const indexes = [
{
key: {
'overleaf.id': 1,
},
name: 'overleaf.id_1',
},
]
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.userstubs, indexes)
}
exports.rollback = async client => {
const { db } = client
try {
await Helpers.dropIndexesFromCollection(db.userstubs, indexes)
} catch (err) {
console.error('Something went wrong rolling back the migrations', err)
}
}
| overleaf/web/migrations/20190912145033_create_userstubs_indexes.js/0 | {
"file_path": "overleaf/web/migrations/20190912145033_create_userstubs_indexes.js",
"repo_id": "overleaf",
"token_count": 215
} | 603 |
const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const indexes = [
{
key: {
'overleaf.history.display': 1,
},
name: 'overleaf.history.display_1',
},
]
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.projects, indexes)
}
exports.rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.projects, indexes)
}
| overleaf/web/migrations/20210721081758_create_history_display_index.js/0 | {
"file_path": "overleaf/web/migrations/20210721081758_create_history_display_index.js",
"repo_id": "overleaf",
"token_count": 163
} | 604 |
require('../../../../../test/acceptance/src/helpers/InitApp')
| overleaf/web/modules/launchpad/test/acceptance/src/Init.js/0 | {
"file_path": "overleaf/web/modules/launchpad/test/acceptance/src/Init.js",
"repo_id": "overleaf",
"token_count": 21
} | 605 |
const UserActivateRouter = require('./app/src/UserActivateRouter')
module.exports = { router: UserActivateRouter }
| overleaf/web/modules/user-activate/index.js/0 | {
"file_path": "overleaf/web/modules/user-activate/index.js",
"repo_id": "overleaf",
"token_count": 37
} | 606 |
'use strict'
const fs = require('fs')
const minimist = require('minimist')
const readline = require('readline')
const {
db,
ObjectId,
waitForDb,
} = require('../../app/src/infrastructure/mongodb')
const DocstoreManager = require('../../app/src/Features/Docstore/DocstoreManager')
.promises
const argv = minimist(process.argv.slice(2))
const commit = argv.commit !== undefined
const offset = parseInt(argv.offset) || 0
const limit = parseInt(argv.limit) || 0
if (!commit) {
console.log('DOING DRY RUN. TO SAVE CHANGES PASS --commit')
}
const input = fs.createReadStream(argv._[0])
const rl = readline.createInterface({
crlfDelay: Infinity,
input,
})
const orphanedDocs = {}
console.log('Loading Data')
let idx = 0
let processed = 0
rl.on('line', async line => {
if (offset && idx++ < offset) {
return
}
if (limit && processed++ >= limit) {
return
}
let [docId, projectId] = line.split(',')
docId = docId.replace(/^ObjectId\(/, '').replace(/\)$/, '')
projectId = projectId.replace(/^ObjectId\(/, '').replace(/\)$/, '')
try {
docId = ObjectId(docId).toString()
projectId = ObjectId(projectId).toString()
} catch (err) {
console.error(`Invalid id: ${docId}, ${projectId}`)
return
}
if (!orphanedDocs[projectId]) {
orphanedDocs[projectId] = []
}
orphanedDocs[projectId].push(docId)
})
rl.on('close', async () => {
const docCount = Object.values(orphanedDocs).reduce((i, v) => i + v.length, 0)
const projectCount = Object.keys(orphanedDocs).length
console.log(`Loaded Data for ${docCount} docs in ${projectCount} Projects`)
await waitForDb()
for (const projectId of Object.keys(orphanedDocs)) {
await deleteOrphanedDocs(projectId, orphanedDocs[projectId])
}
console.log('DONE')
process.exit()
})
async function deleteOrphanedDocs(projectId, docIds) {
try {
if (await projectIdExists(projectId)) {
console.error(`Project id exists: ${projectId}`)
return
}
} catch (err) {
console.error(`Error checking if project exists: ${projectId}`, err.stack)
return
}
console.log(`Delete docs ${docIds.join(', ')} for project ${projectId}`)
if (!commit) {
return
}
try {
await DocstoreManager.destroyProject(projectId)
} catch (err) {
console.error(`Error deleting project ${projectId}`, err)
}
}
async function projectIdExists(projectId) {
// check both projects and deletedProjects to see if project id exists
const [project, deletedProject] = await Promise.all([
findProject(projectId),
findDeletedProject(projectId),
])
return project !== null || deletedProject !== null
}
async function findProject(projectId) {
return db.projects.findOne(
{ _id: ObjectId(projectId) },
{ projection: { _id: 1 } }
)
}
async function findDeletedProject(projectId) {
return db.deletedProjects.findOne(
{ 'project._id': ObjectId(projectId) },
{ projection: { _id: 1 } }
)
}
| overleaf/web/scripts/delete-orphaned-docs/delete-orphaned-docs.js/0 | {
"file_path": "overleaf/web/scripts/delete-orphaned-docs/delete-orphaned-docs.js",
"repo_id": "overleaf",
"token_count": 1069
} | 607 |
source 'https://rubygems.org'
gem 'recurly'
gem 'json' | overleaf/web/scripts/recurly/Gemfile/0 | {
"file_path": "overleaf/web/scripts/recurly/Gemfile",
"repo_id": "overleaf",
"token_count": 23
} | 608 |
const { merge } = require('@overleaf/settings/merge')
const base = require('./settings.test.defaults')
module.exports = base.mergeWith({})
module.exports.mergeWith = function (overrides) {
return merge(overrides, module.exports)
}
| overleaf/web/test/acceptance/config/settings.test.server-ce.js/0 | {
"file_path": "overleaf/web/test/acceptance/config/settings.test.server-ce.js",
"repo_id": "overleaf",
"token_count": 80
} | 609 |
const User = require('./helpers/User')
const request = require('./helpers/request')
const { expect } = require('chai')
const settings = require('@overleaf/settings')
const { ObjectId } = require('mongodb')
describe('DocUpdate', function () {
beforeEach(function (done) {
this.user = new User()
this.projectName = 'wombat'
this.user.ensureUserExists(() => {
this.user.login(() => {
this.user.createProject(this.projectName, (error, projectId) => {
if (error) return done(error)
this.projectId = projectId
this.user.getProject(this.projectId, (error, project) => {
if (error) return done(error)
this.project = project
this.user.createDocInProject(
this.projectId,
this.project.rootFolder[0]._id,
'potato',
(error, docId) => {
this.docId = docId
done(error)
}
)
})
})
})
})
})
function writeContent(
{ projectId, docId, lines, version, ranges, lastUpdatedAt, lastUpdatedBy },
callback
) {
request(
{
method: 'POST',
url: `/project/${projectId}/doc/${docId}`,
auth: {
user: settings.apis.web.user,
pass: settings.apis.web.pass,
sendImmediately: true,
},
json: { lines, version, ranges, lastUpdatedAt, lastUpdatedBy },
},
(error, res) => {
if (error) return callback(error)
if (res.statusCode !== 200)
return callback(
new Error(`non-success statusCode: ${res.statusCode}`)
)
callback()
}
)
}
function updateContent(options, callback) {
writeContent(options, err => {
if (err) return callback(err)
options.lines.push('foo')
options.version++
writeContent(options, callback)
})
}
function writeContentTwice(options, callback) {
writeContent(options, err => {
if (err) return callback(err)
writeContent(options, callback)
})
}
let writeOptions
beforeEach(function () {
writeOptions = {
projectId: this.projectId,
docId: this.docId,
lines: ['a'],
version: 1,
ranges: {},
lastUpdatedAt: new Date(),
lastUpdatedBy: this.user.id,
}
})
function shouldAcceptChanges() {
it('should accept writes', function (done) {
writeContent(writeOptions, done)
})
it('should accept updates', function (done) {
updateContent(writeOptions, done)
})
it('should accept same write twice', function (done) {
writeContentTwice(writeOptions, done)
})
}
function shouldBlockChanges() {
it('should block writes', function (done) {
writeContent(writeOptions, err => {
expect(err).to.exist
expect(err.message).to.equal('non-success statusCode: 404')
done()
})
})
it('should block updates', function (done) {
updateContent(writeOptions, err => {
expect(err).to.exist
expect(err.message).to.equal('non-success statusCode: 404')
done()
})
})
}
describe('a regular doc', function () {
shouldAcceptChanges()
})
describe('after deleting the doc', function () {
beforeEach(function (done) {
this.user.deleteItemInProject(this.projectId, 'doc', this.docId, done)
})
shouldAcceptChanges()
})
describe('unknown doc', function () {
beforeEach(function () {
writeOptions.docId = ObjectId()
})
shouldBlockChanges()
})
describe('doc in another project', function () {
beforeEach(function (done) {
this.user.createProject('foo', (error, projectId) => {
if (error) return done(error)
writeOptions.projectId = projectId
done()
})
})
shouldBlockChanges()
})
})
| overleaf/web/test/acceptance/src/DocUpdateTests.js/0 | {
"file_path": "overleaf/web/test/acceptance/src/DocUpdateTests.js",
"repo_id": "overleaf",
"token_count": 1645
} | 610 |
/* eslint-disable
max-len,
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const { assert, expect } = require('chai')
const async = require('async')
const request = require('./helpers/request')
const assertRedirect = (method, path, expectedStatusCode, destination, cb) =>
request[method](path, (error, response) => {
expect(error).not.to.exist
response.statusCode.should.equal(expectedStatusCode)
response.headers.location.should.equal(destination)
return cb()
})
describe('RedirectUrls', function () {
beforeEach(function () {
return this.timeout(1000)
})
it('proxy static URLs', function (done) {
return assertRedirect('get', '/redirect/one', 302, '/destination/one', done)
})
it('proxy dynamic URLs', function (done) {
return assertRedirect(
'get',
'/redirect/params/42',
302,
'/destination/42/params',
done
)
})
it('proxy URLs with baseUrl', function (done) {
return assertRedirect(
'get',
'/redirect/base_url',
302,
'https://example.com/destination/base_url',
done
)
})
it('proxy URLs with POST with a 307', function (done) {
return assertRedirect(
'post',
'/redirect/get_and_post',
307,
'/destination/get_and_post',
done
)
})
it('proxy URLs with multiple support methods', function (done) {
return assertRedirect(
'get',
'/redirect/get_and_post',
302,
'/destination/get_and_post',
done
)
})
it('redirects with query params', function (done) {
return assertRedirect(
'get',
'/redirect/qs?foo=bar&baz[]=qux1&baz[]=qux2',
302,
'/destination/qs?foo=bar&baz[]=qux1&baz[]=qux2',
done
)
})
it("skips redirects if the 'skip-redirects' header is set", function (done) {
return request.get(
{ url: '/redirect/one', headers: { 'x-skip-redirects': 'true' } },
(error, response) => {
expect(error).not.to.exist
response.statusCode.should.equal(404)
return done()
}
)
})
})
| overleaf/web/test/acceptance/src/RedirectUrlsTests.js/0 | {
"file_path": "overleaf/web/test/acceptance/src/RedirectUrlsTests.js",
"repo_id": "overleaf",
"token_count": 936
} | 611 |
const App = require('../../../../app.js')
const MongoHelper = require('./MongoHelper')
const RedisHelper = require('./RedisHelper')
const { logger } = require('logger-sharelatex')
logger.level('error')
MongoHelper.initialize()
RedisHelper.initialize()
let server
before('start main app', function (done) {
server = App.listen(3000, 'localhost', done)
})
after('stop main app', function (done) {
if (!server) {
return done()
}
server.close(done)
})
| overleaf/web/test/acceptance/src/helpers/InitApp.js/0 | {
"file_path": "overleaf/web/test/acceptance/src/helpers/InitApp.js",
"repo_id": "overleaf",
"token_count": 157
} | 612 |
const AbstractMockApi = require('./AbstractMockApi')
class MockChatApi extends AbstractMockApi {
reset() {
this.projects = {}
}
getGlobalMessages(req, res) {
res.send(this.projects[req.params.project_id] || [])
}
sendGlobalMessage(req, res) {
const projectId = req.params.project_id
const message = {
id: Math.random().toString(),
content: req.body.content,
timestamp: Date.now(),
user_id: req.body.user_id,
}
this.projects[projectId] = this.projects[projectId] || []
this.projects[projectId].push(message)
res.sendStatus(201).send(Object.assign({ room_id: projectId }, message))
}
applyRoutes() {
this.app.get('/project/:project_id/messages', (req, res) =>
this.getGlobalMessages(req, res)
)
this.app.post('/project/:project_id/messages', (req, res) =>
this.sendGlobalMessage(req, res)
)
}
}
module.exports = MockChatApi
// type hint for the inherited `instance` method
/**
* @function instance
* @memberOf MockChatApi
* @static
* @returns {MockChatApi}
*/
| overleaf/web/test/acceptance/src/mocks/MockChatApi.js/0 | {
"file_path": "overleaf/web/test/acceptance/src/mocks/MockChatApi.js",
"repo_id": "overleaf",
"token_count": 418
} | 613 |
import sinon from 'sinon'
export function stubMathJax() {
window.MathJax = {
Hub: {
Queue: sinon.stub(),
config: { tex2jax: { inlineMath: [['$', '$']] } },
},
}
}
export function tearDownMathJaxStubs() {
delete window.MathJax
}
| overleaf/web/test/frontend/features/chat/components/stubs.js/0 | {
"file_path": "overleaf/web/test/frontend/features/chat/components/stubs.js",
"repo_id": "overleaf",
"token_count": 111
} | 614 |
import { expect } from 'chai'
import sinon from 'sinon'
import { screen, fireEvent, cleanup } from '@testing-library/react'
import renderWithContext from '../../helpers/render-with-context'
import FileTreeItemName from '../../../../../../frontend/js/features/file-tree/components/file-tree-item/file-tree-item-name'
describe('<FileTreeItemName />', function () {
const sandbox = sinon.createSandbox()
const setIsDraggable = sinon.stub()
beforeEach(function () {
sandbox.spy(window, 'requestAnimationFrame')
})
afterEach(function () {
sandbox.restore()
setIsDraggable.reset()
cleanup()
})
it('renders name as button', function () {
renderWithContext(
<FileTreeItemName
name="foo.tex"
isSelected
setIsDraggable={setIsDraggable}
/>
)
screen.getByRole('button', { name: 'foo.tex' })
expect(screen.queryByRole('textbox')).to.not.exist
})
it("doesn't start renaming on unselected component", function () {
renderWithContext(
<FileTreeItemName
name="foo.tex"
isSelected={false}
setIsDraggable={setIsDraggable}
/>
)
const button = screen.queryByRole('button')
fireEvent.click(button)
fireEvent.click(button)
fireEvent.doubleClick(button)
expect(screen.queryByRole('textbox')).to.not.exist
})
it('start renaming on double-click', function () {
renderWithContext(
<FileTreeItemName
name="foo.tex"
isSelected
setIsDraggable={setIsDraggable}
/>
)
const button = screen.queryByRole('button')
fireEvent.click(button)
fireEvent.click(button)
fireEvent.doubleClick(button)
screen.getByRole('textbox')
expect(screen.queryByRole('button')).to.not.exist
expect(window.requestAnimationFrame).to.be.calledOnce
expect(setIsDraggable).to.be.calledWith(false)
})
it('cannot start renaming in read-only', function () {
renderWithContext(
<FileTreeItemName
name="foo.tex"
isSelected
setIsDraggable={setIsDraggable}
/>,
{
contextProps: { hasWritePermissions: false },
}
)
const button = screen.queryByRole('button')
fireEvent.click(button)
fireEvent.click(button)
fireEvent.doubleClick(button)
expect(screen.queryByRole('textbox')).to.not.exist
})
describe('stop renaming', function () {
beforeEach(function () {
renderWithContext(
<FileTreeItemName
name="foo.tex"
isSelected
setIsDraggable={setIsDraggable}
/>
)
const button = screen.getByRole('button')
fireEvent.click(button)
fireEvent.click(button)
fireEvent.doubleClick(button)
const input = screen.getByRole('textbox')
fireEvent.change(input, { target: { value: 'bar.tex' } })
})
it('on Escape', function () {
const input = screen.getByRole('textbox')
fireEvent.keyDown(input, { key: 'Escape' })
screen.getByRole('button', { name: 'foo.tex' })
expect(setIsDraggable).to.be.calledWith(true)
})
})
})
| overleaf/web/test/frontend/features/file-tree/components/file-tree-item/file-tree-item-name.test.js/0 | {
"file_path": "overleaf/web/test/frontend/features/file-tree/components/file-tree-item/file-tree-item-name.test.js",
"repo_id": "overleaf",
"token_count": 1250
} | 615 |
import { expect } from 'chai'
import sinon from 'sinon'
import { screen, fireEvent } from '@testing-library/react'
import OutlinePane from '../../../../../frontend/js/features/outline/components/outline-pane'
import { renderWithEditorContext } from '../../../helpers/render-with-context'
describe('<OutlinePane />', function () {
const jumpToLine = () => {}
const onToggle = sinon.stub()
const eventTracking = { sendMB: sinon.stub() }
function render(children) {
renderWithEditorContext(children, { projectId: '123abc' })
}
let originalLocalStorage
before(function () {
originalLocalStorage = global.localStorage
Object.defineProperty(global, 'localStorage', {
value: {
getItem: sinon.stub().returns(null),
setItem: sinon.stub(),
},
})
})
afterEach(function () {
onToggle.reset()
eventTracking.sendMB.reset()
global.localStorage.getItem.resetHistory()
global.localStorage.setItem.resetHistory()
})
after(function () {
Object.defineProperty(global, 'localStorage', {
value: originalLocalStorage,
})
})
it('renders expanded outline', function () {
const outline = [
{
title: 'Section',
line: 1,
level: 10,
},
]
render(
<OutlinePane
isTexFile
outline={outline}
jumpToLine={jumpToLine}
onToggle={onToggle}
eventTracking={eventTracking}
/>
)
screen.getByRole('tree')
})
it('renders disabled outline', function () {
const outline = []
render(
<OutlinePane
isTexFile={false}
outline={outline}
jumpToLine={jumpToLine}
onToggle={onToggle}
eventTracking={eventTracking}
/>
)
expect(screen.queryByRole('tree')).to.be.null
})
it('expand outline and use local storage', function () {
global.localStorage.getItem.returns(false)
const outline = [
{
title: 'Section',
line: 1,
level: 10,
},
]
render(
<OutlinePane
isTexFile
outline={outline}
jumpToLine={jumpToLine}
onToggle={onToggle}
eventTracking={eventTracking}
/>
)
expect(screen.queryByRole('tree')).to.be.null
const collapseButton = screen.getByRole('button', {
name: 'Show File outline',
})
fireEvent.click(collapseButton)
screen.getByRole('tree')
expect(global.localStorage.setItem).to.be.calledOnce
expect(global.localStorage.setItem).to.be.calledWithMatch(/123abc/, 'true')
expect(onToggle).to.be.calledTwice
})
})
| overleaf/web/test/frontend/features/outline/components/outline-pane.test.js/0 | {
"file_path": "overleaf/web/test/frontend/features/outline/components/outline-pane.test.js",
"repo_id": "overleaf",
"token_count": 1076
} | 616 |
import { expect } from 'chai'
import fetchMock from 'fetch-mock'
import {
deleteJSON,
FetchError,
getJSON,
postJSON,
putJSON,
} from '../../../frontend/js/infrastructure/fetch-json'
describe('fetchJSON', function () {
before(function () {
fetchMock.restore()
})
afterEach(function () {
fetchMock.restore()
})
const headers = {
Accept: 'application/json',
'Content-Type': 'application/json',
}
it('handles GET requests', function () {
fetchMock.once(
{ method: 'GET', url: '/test', headers },
{ status: 200, body: { result: 'success' } }
)
return expect(getJSON('/test')).to.eventually.deep.equal({
result: 'success',
})
})
it('handles 4xx responses', function () {
fetchMock.get('/test', {
status: 400,
body: { message: 'The request was invalid' },
})
return expect(getJSON('/test'))
.to.eventually.be.rejectedWith('Bad Request')
.and.be.an.instanceOf(FetchError)
.to.nested.include({
message: 'Bad Request',
'data.message': 'The request was invalid',
'response.status': 400,
'info.statusCode': 400,
})
})
it('handles 5xx responses', async function () {
fetchMock.get('/test', { status: 500 })
return expect(getJSON('/test'))
.to.eventually.be.rejectedWith('Internal Server Error')
.and.be.an.instanceOf(FetchError)
.to.nested.include({
'response.status': 500,
'info.statusCode': 500,
})
})
it('handles JSON error responses', async function () {
fetchMock.get('/test', {
status: 500,
headers: {
'Content-Type': 'application/json',
},
body: { message: 'lorem ipsum' },
})
return expect(getJSON('/test'))
.to.eventually.be.rejectedWith('Internal Server Error')
.and.be.an.instanceOf(FetchError)
.to.nested.include({
'data.message': 'lorem ipsum',
})
})
it('handles text error responses', async function () {
fetchMock.get('/test', {
status: 500,
headers: {
'Content-Type': 'text/plain',
},
body: 'lorem ipsum',
})
return expect(getJSON('/test'))
.to.eventually.be.rejectedWith('Internal Server Error')
.and.be.an.instanceOf(FetchError)
.to.nested.include({
'data.message': 'lorem ipsum',
})
})
it('handles text error responses sent as HTML', async function () {
fetchMock.get('/test', {
status: 500,
headers: {
'Content-Type': 'text/html',
},
body: 'lorem ipsum',
})
return expect(getJSON('/test'))
.to.eventually.be.rejectedWith('Internal Server Error')
.and.be.an.instanceOf(FetchError)
.to.nested.include({
'data.message': 'lorem ipsum',
})
})
it('handles (ignores) HTML error responses sent as HTML', async function () {
fetchMock.get('/test', {
status: 500,
headers: {
'Content-Type': 'text/html',
},
body:
'<!doctype html><html lang="en"><body><p>lorem ipsum</p></body></html>',
})
const promise = getJSON('/test')
expect(promise)
.to.eventually.be.rejectedWith('Internal Server Error')
.and.be.an.instanceOf(FetchError)
try {
await promise
} catch (error) {
expect(error.data).to.eql({})
}
})
it('handles POST requests', function () {
const body = { example: true }
fetchMock.once(
{ method: 'POST', url: '/test', headers, body },
{ status: 200, body: { result: 'success' } }
)
return expect(postJSON('/test', { body })).to.eventually.deep.equal({
result: 'success',
})
})
it('handles PUT requests', function () {
const body = { example: true }
fetchMock.once(
{ method: 'PUT', url: '/test', headers, body },
{ status: 200, body: { result: 'success' } }
)
return expect(putJSON('/test', { body })).to.eventually.deep.equal({
result: 'success',
})
})
it('handles DELETE requests', function () {
fetchMock.once({ method: 'DELETE', url: '/test', headers }, { status: 204 })
return expect(deleteJSON('/test')).to.eventually.deep.equal({})
})
})
| overleaf/web/test/frontend/infrastructure/fetch-json.test.js/0 | {
"file_path": "overleaf/web/test/frontend/infrastructure/fetch-json.test.js",
"repo_id": "overleaf",
"token_count": 1768
} | 617 |
async function run({ getCsrfTokenFor }) {
const loginCsrfToken = await getCsrfTokenFor('/login')
return { loginCsrfToken }
}
module.exports = { run }
| overleaf/web/test/smoke/src/steps/000_getLoginCsrf.js/0 | {
"file_path": "overleaf/web/test/smoke/src/steps/000_getLoginCsrf.js",
"repo_id": "overleaf",
"token_count": 56
} | 618 |
const sinon = require('sinon')
const { expect } = require('chai')
const SandboxedModule = require('sandboxed-module')
const Errors = require('../../../../app/src/Features/Errors/Errors.js')
const MODULE_PATH =
'../../../../app/src/Features/Authorization/AuthorizationMiddleware.js'
describe('AuthorizationMiddleware', function () {
beforeEach(function () {
this.userId = 'user-id-123'
this.project_id = 'project-id-123'
this.token = 'some-token'
this.AuthenticationController = {}
this.SessionManager = {
getLoggedInUserId: sinon.stub().returns(this.userId),
isUserLoggedIn: sinon.stub().returns(true),
}
this.AuthorizationManager = {}
this.HttpErrorHandler = {
forbidden: sinon.stub(),
}
this.TokenAccessHandler = {
getRequestToken: sinon.stub().returns(this.token),
}
this.ObjectId = {
isValid: sinon.stub().withArgs(this.project_id).returns(true),
}
this.AuthorizationManager = {}
this.AuthorizationMiddleware = SandboxedModule.require(MODULE_PATH, {
requires: {
'./AuthorizationManager': this.AuthorizationManager,
mongodb: {
ObjectId: this.ObjectId,
},
'../Errors/HttpErrorHandler': this.HttpErrorHandler,
'../Authentication/AuthenticationController': this
.AuthenticationController,
'../Authentication/SessionManager': this.SessionManager,
'../TokenAccess/TokenAccessHandler': this.TokenAccessHandler,
},
})
this.req = {}
this.res = {}
this.next = sinon.stub()
})
describe('_getUserId', function () {
beforeEach(function () {
this.req = {}
})
it('should get the user from session', function (done) {
this.SessionManager.getLoggedInUserId = sinon.stub().returns('1234')
this.AuthorizationMiddleware._getUserId(this.req, (err, userId) => {
expect(err).to.not.exist
expect(userId).to.equal('1234')
done()
})
})
it('should get oauth_user from request', function (done) {
this.SessionManager.getLoggedInUserId = sinon.stub().returns(null)
this.req.oauth_user = { _id: '5678' }
this.AuthorizationMiddleware._getUserId(this.req, (err, userId) => {
expect(err).to.not.exist
expect(userId).to.equal('5678')
done()
})
})
it('should fall back to null', function (done) {
this.SessionManager.getLoggedInUserId = sinon.stub().returns(null)
this.req.oauth_user = undefined
this.AuthorizationMiddleware._getUserId(this.req, (err, userId) => {
expect(err).to.not.exist
expect(userId).to.equal(null)
done()
})
})
})
const METHODS_TO_TEST = {
ensureUserCanReadProject: 'canUserReadProject',
ensureUserCanWriteProjectSettings: 'canUserWriteProjectSettings',
ensureUserCanWriteProjectContent: 'canUserWriteProjectContent',
}
Object.entries(METHODS_TO_TEST).forEach(
([middlewareMethod, managerMethod]) => {
describe(middlewareMethod, function () {
beforeEach(function () {
this.req.params = { project_id: this.project_id }
this.AuthorizationManager[managerMethod] = sinon.stub()
this.AuthorizationMiddleware.redirectToRestricted = sinon.stub()
})
describe('with missing project_id', function () {
beforeEach(function () {
this.req.params = {}
})
it('should return an error to next', function () {
this.AuthorizationMiddleware[middlewareMethod](
this.req,
this.res,
this.next
)
this.next
.calledWith(sinon.match.instanceOf(Error))
.should.equal(true)
})
})
describe('with logged in user', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(this.userId)
})
describe('when user has permission', function () {
beforeEach(function () {
this.AuthorizationManager[managerMethod]
.withArgs(this.userId, this.project_id, this.token)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware[middlewareMethod](
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission", function () {
beforeEach(function () {
this.AuthorizationManager[managerMethod]
.withArgs(this.userId, this.project_id, this.token)
.yields(null, false)
})
it('should raise a 403', function () {
this.AuthorizationMiddleware[middlewareMethod](
this.req,
this.res,
this.next
)
this.next.called.should.equal(false)
this.HttpErrorHandler.forbidden
.calledWith(this.req, this.res)
.should.equal(true)
})
})
})
describe('with anonymous user', function () {
describe('when user has permission', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager[managerMethod]
.withArgs(null, this.project_id, this.token)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware[middlewareMethod](
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission", function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager[managerMethod]
.withArgs(null, this.project_id, this.token)
.yields(null, false)
})
it('should redirect to redirectToRestricted', function () {
this.AuthorizationMiddleware[middlewareMethod](
this.req,
this.res,
this.next
)
this.next.called.should.equal(false)
this.HttpErrorHandler.forbidden
.calledWith(this.req, this.res)
.should.equal(true)
})
})
})
describe('with malformed project id', function () {
beforeEach(function () {
this.req.params = { project_id: 'blah' }
this.ObjectId.isValid = sinon.stub().returns(false)
})
it('should return a not found error', function (done) {
this.AuthorizationMiddleware[middlewareMethod](
this.req,
this.res,
error => {
error.should.be.instanceof(Errors.NotFoundError)
return done()
}
)
})
})
})
}
)
describe('ensureUserCanAdminProject', function () {
beforeEach(function () {
this.req.params = { project_id: this.project_id }
this.AuthorizationManager.canUserAdminProject = sinon.stub()
this.AuthorizationMiddleware.redirectToRestricted = sinon.stub()
})
describe('with missing project_id', function () {
beforeEach(function () {
this.req.params = {}
})
it('should return an error to next', function () {
this.AuthorizationMiddleware.ensureUserCanAdminProject(
this.req,
this.res,
this.next
)
this.next.calledWith(sinon.match.instanceOf(Error)).should.equal(true)
})
})
describe('with logged in user', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(this.userId)
})
describe('when user has permission', function () {
beforeEach(function () {
this.AuthorizationManager.canUserAdminProject
.withArgs(this.userId, this.project_id, this.token)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware.ensureUserCanAdminProject(
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission", function () {
beforeEach(function () {
this.AuthorizationManager.canUserAdminProject
.withArgs(this.userId, this.project_id, this.token)
.yields(null, false)
})
it('should invoke HTTP forbidden error handler', function (done) {
this.HttpErrorHandler.forbidden = sinon.spy(() => done())
this.AuthorizationMiddleware.ensureUserCanAdminProject(
this.req,
this.res
)
})
})
})
describe('with anonymous user', function () {
describe('when user has permission', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager.canUserAdminProject
.withArgs(null, this.project_id, this.token)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware.ensureUserCanAdminProject(
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission", function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager.canUserAdminProject
.withArgs(null, this.project_id, this.token)
.yields(null, false)
})
it('should invoke HTTP forbidden error handler', function (done) {
this.HttpErrorHandler.forbidden = sinon.spy(() => done())
this.AuthorizationMiddleware.ensureUserCanAdminProject(
this.req,
this.res
)
})
})
})
describe('with malformed project id', function () {
beforeEach(function () {
this.req.params = { project_id: 'blah' }
this.ObjectId.isValid = sinon.stub().returns(false)
})
it('should return a not found error', function (done) {
this.AuthorizationMiddleware.ensureUserCanAdminProject(
this.req,
this.res,
error => {
error.should.be.instanceof(Errors.NotFoundError)
return done()
}
)
})
})
})
describe('ensureUserIsSiteAdmin', function () {
beforeEach(function () {
this.AuthorizationManager.isUserSiteAdmin = sinon.stub()
this.AuthorizationMiddleware.redirectToRestricted = sinon.stub()
})
describe('with logged in user', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(this.userId)
})
describe('when user has permission', function () {
beforeEach(function () {
this.AuthorizationManager.isUserSiteAdmin
.withArgs(this.userId)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware.ensureUserIsSiteAdmin(
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission", function () {
beforeEach(function () {
this.AuthorizationManager.isUserSiteAdmin
.withArgs(this.userId)
.yields(null, false)
})
it('should redirect to redirectToRestricted', function () {
this.AuthorizationMiddleware.ensureUserIsSiteAdmin(
this.req,
this.res,
this.next
)
this.next.called.should.equal(false)
this.AuthorizationMiddleware.redirectToRestricted
.calledWith(this.req, this.res, this.next)
.should.equal(true)
})
})
})
describe('with anonymous user', function () {
describe('when user has permission', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager.isUserSiteAdmin
.withArgs(null)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware.ensureUserIsSiteAdmin(
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission", function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager.isUserSiteAdmin
.withArgs(null)
.yields(null, false)
})
it('should redirect to redirectToRestricted', function () {
this.AuthorizationMiddleware.ensureUserIsSiteAdmin(
this.req,
this.res,
this.next
)
this.next.called.should.equal(false)
this.AuthorizationMiddleware.redirectToRestricted
.calledWith(this.req, this.res, this.next)
.should.equal(true)
})
})
})
})
describe('blockRestrictedUserFromProject', function () {
beforeEach(function () {
this.AuthorizationMiddleware._getUserAndProjectId = sinon
.stub()
.callsArgWith(1, null, this.userId, this.project_id)
})
it('should issue a 401 response for a restricted user', function (done) {
this.AuthorizationManager.isRestrictedUserForProject = sinon
.stub()
.callsArgWith(3, null, true)
this.req = {}
this.next = sinon.stub()
this.res.sendStatus = status => {
expect(status).to.equal(403)
expect(
this.AuthorizationManager.isRestrictedUserForProject.called
).to.equal(true)
expect(this.next.called).to.equal(false)
done()
}
this.AuthorizationMiddleware.blockRestrictedUserFromProject(
this.req,
this.res,
this.next
)
})
it('should pass through for a regular user', function (done) {
this.AuthorizationManager.isRestrictedUserForProject = sinon
.stub()
.callsArgWith(3, null, false)
this.req = {}
this.res.sendStatus = sinon.stub()
this.next = status => {
expect(
this.AuthorizationManager.isRestrictedUserForProject.called
).to.equal(true)
expect(this.res.sendStatus.called).to.equal(false)
done()
}
this.AuthorizationMiddleware.blockRestrictedUserFromProject(
this.req,
this.res,
this.next
)
})
})
describe('ensureUserCanReadMultipleProjects', function () {
beforeEach(function () {
this.AuthorizationManager.canUserReadProject = sinon.stub()
this.AuthorizationMiddleware.redirectToRestricted = sinon.stub()
this.req.query = { project_ids: 'project1,project2' }
})
describe('with logged in user', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(this.userId)
})
describe('when user has permission to access all projects', function () {
beforeEach(function () {
this.AuthorizationManager.canUserReadProject
.withArgs(this.userId, 'project1', this.token)
.yields(null, true)
this.AuthorizationManager.canUserReadProject
.withArgs(this.userId, 'project2', this.token)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware.ensureUserCanReadMultipleProjects(
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission to access one of the projects", function () {
beforeEach(function () {
this.AuthorizationManager.canUserReadProject
.withArgs(this.userId, 'project1', this.token)
.yields(null, true)
this.AuthorizationManager.canUserReadProject
.withArgs(this.userId, 'project2', this.token)
.yields(null, false)
})
it('should redirect to redirectToRestricted', function () {
this.AuthorizationMiddleware.ensureUserCanReadMultipleProjects(
this.req,
this.res,
this.next
)
this.next.called.should.equal(false)
this.AuthorizationMiddleware.redirectToRestricted
.calledWith(this.req, this.res, this.next)
.should.equal(true)
})
})
})
describe('with anonymous user', function () {
describe('when user has permission', function () {
describe('when user has permission to access all projects', function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager.canUserReadProject
.withArgs(null, 'project1', this.token)
.yields(null, true)
this.AuthorizationManager.canUserReadProject
.withArgs(null, 'project2', this.token)
.yields(null, true)
})
it('should return next', function () {
this.AuthorizationMiddleware.ensureUserCanReadMultipleProjects(
this.req,
this.res,
this.next
)
this.next.called.should.equal(true)
})
})
describe("when user doesn't have permission to access one of the projects", function () {
beforeEach(function () {
this.SessionManager.getLoggedInUserId.returns(null)
this.AuthorizationManager.canUserReadProject
.withArgs(null, 'project1', this.token)
.yields(null, true)
this.AuthorizationManager.canUserReadProject
.withArgs(null, 'project2', this.token)
.yields(null, false)
})
it('should redirect to redirectToRestricted', function () {
this.AuthorizationMiddleware.ensureUserCanReadMultipleProjects(
this.req,
this.res,
this.next
)
this.next.called.should.equal(false)
this.AuthorizationMiddleware.redirectToRestricted
.calledWith(this.req, this.res, this.next)
.should.equal(true)
})
})
})
})
})
})
| overleaf/web/test/unit/src/Authorization/AuthorizationMiddlewareTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Authorization/AuthorizationMiddlewareTests.js",
"repo_id": "overleaf",
"token_count": 8835
} | 619 |
/* eslint-disable
camelcase,
max-len,
no-return-assign,
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const sinon = require('sinon')
const { assert, expect } = require('chai')
const modulePath = '../../../../app/src/Features/Compile/CompileController.js'
const SandboxedModule = require('sandboxed-module')
const MockRequest = require('../helpers/MockRequest')
const MockResponse = require('../helpers/MockResponse')
describe('CompileController', function () {
beforeEach(function () {
this.user_id = 'wat'
this.user = {
_id: this.user_id,
email: 'user@example.com',
features: {
compileGroup: 'premium',
compileTimeout: 100,
},
}
this.CompileManager = { compile: sinon.stub() }
this.ClsiManager = {}
this.UserGetter = { getUser: sinon.stub() }
this.RateLimiter = { addCount: sinon.stub() }
this.settings = {
apis: {
clsi: {
url: 'clsi.example.com',
},
clsi_priority: {
url: 'clsi-priority.example.com',
},
},
defaultFeatures: {
compileGroup: 'standard',
compileTimeout: 60,
},
}
this.jar = { cookie: 'stuff' }
this.ClsiCookieManager = {
getCookieJar: sinon.stub().callsArgWith(1, null, this.jar),
}
this.SessionManager = {
getLoggedInUser: sinon.stub().callsArgWith(1, null, this.user),
getLoggedInUserId: sinon.stub().returns(this.user_id),
getSessionUser: sinon.stub().returns(this.user),
isUserLoggedIn: sinon.stub().returns(true),
}
this.CompileController = SandboxedModule.require(modulePath, {
requires: {
'@overleaf/settings': this.settings,
request: (this.request = sinon.stub()),
'../Project/ProjectGetter': (this.ProjectGetter = {}),
'@overleaf/metrics': (this.Metrics = { inc: sinon.stub() }),
'./CompileManager': this.CompileManager,
'../User/UserGetter': this.UserGetter,
'./ClsiManager': this.ClsiManager,
'../Authentication/SessionManager': this.SessionManager,
'../../infrastructure/RateLimiter': this.RateLimiter,
'./ClsiCookieManager': () => this.ClsiCookieManager,
},
})
this.project_id = 'project-id'
this.next = sinon.stub()
this.req = new MockRequest()
return (this.res = new MockResponse())
})
describe('compile', function () {
beforeEach(function () {
this.req.params = { Project_id: this.project_id }
this.req.session = {}
return (this.CompileManager.compile = sinon
.stub()
.callsArgWith(
3,
null,
(this.status = 'success'),
(this.outputFiles = ['mock-output-files'])
))
})
describe('when not an auto compile', function () {
beforeEach(function () {
return this.CompileController.compile(this.req, this.res, this.next)
})
it('should look up the user id', function () {
return this.SessionManager.getLoggedInUserId
.calledWith(this.req.session)
.should.equal(true)
})
it('should do the compile without the auto compile flag', function () {
return this.CompileManager.compile
.calledWith(this.project_id, this.user_id, {
isAutoCompile: false,
enablePdfCaching: false,
})
.should.equal(true)
})
it('should set the content-type of the response to application/json', function () {
this.res.type.should.equal('application/json')
})
it('should send a successful response reporting the status and files', function () {
this.res.statusCode.should.equal(200)
this.res.body.should.equal(
JSON.stringify({
status: this.status,
outputFiles: this.outputFiles,
})
)
})
})
describe('when an auto compile', function () {
beforeEach(function () {
this.req.query = { auto_compile: 'true' }
return this.CompileController.compile(this.req, this.res, this.next)
})
it('should do the compile with the auto compile flag', function () {
return this.CompileManager.compile
.calledWith(this.project_id, this.user_id, {
isAutoCompile: true,
enablePdfCaching: false,
})
.should.equal(true)
})
})
describe('with the draft attribute', function () {
beforeEach(function () {
this.req.body = { draft: true }
return this.CompileController.compile(this.req, this.res, this.next)
})
it('should do the compile without the draft compile flag', function () {
return this.CompileManager.compile
.calledWith(this.project_id, this.user_id, {
isAutoCompile: false,
enablePdfCaching: false,
draft: true,
})
.should.equal(true)
})
})
})
describe('compileSubmission', function () {
beforeEach(function () {
this.submission_id = 'sub-1234'
this.req.params = { submission_id: this.submission_id }
this.req.body = {}
return (this.ClsiManager.sendExternalRequest = sinon
.stub()
.callsArgWith(
3,
null,
(this.status = 'success'),
(this.outputFiles = ['mock-output-files']),
(this.clsiServerId = 'mock-server-id'),
(this.validationProblems = null)
))
})
it('should set the content-type of the response to application/json', function () {
this.CompileController.compileSubmission(this.req, this.res, this.next)
return this.res.contentType
.calledWith('application/json')
.should.equal(true)
})
it('should send a successful response reporting the status and files', function () {
this.CompileController.compileSubmission(this.req, this.res, this.next)
this.res.statusCode.should.equal(200)
return this.res.body.should.equal(
JSON.stringify({
status: this.status,
outputFiles: this.outputFiles,
clsiServerId: 'mock-server-id',
validationProblems: null,
})
)
})
describe('with compileGroup and timeout', function () {
beforeEach(function () {
this.req.body = {
compileGroup: 'special',
timeout: 600,
}
return this.CompileController.compileSubmission(
this.req,
this.res,
this.next
)
})
it('should use the supplied values', function () {
return this.ClsiManager.sendExternalRequest
.calledWith(
this.submission_id,
{ compileGroup: 'special', timeout: 600 },
{ compileGroup: 'special', timeout: 600 }
)
.should.equal(true)
})
})
describe('with other supported options but not compileGroup and timeout', function () {
beforeEach(function () {
this.req.body = {
rootResourcePath: 'main.tex',
compiler: 'lualatex',
draft: true,
check: 'validate',
}
return this.CompileController.compileSubmission(
this.req,
this.res,
this.next
)
})
it('should use the other options but default values for compileGroup and timeout', function () {
return this.ClsiManager.sendExternalRequest
.calledWith(
this.submission_id,
{
rootResourcePath: 'main.tex',
compiler: 'lualatex',
draft: true,
check: 'validate',
},
{
rootResourcePath: 'main.tex',
compiler: 'lualatex',
draft: true,
check: 'validate',
compileGroup: 'standard',
timeout: 60,
}
)
.should.equal(true)
})
})
})
describe('downloadPdf', function () {
beforeEach(function () {
this.req.params = { Project_id: this.project_id }
this.req.query = { pdfng: true }
this.project = { name: 'test namè' }
return (this.ProjectGetter.getProject = sinon
.stub()
.callsArgWith(2, null, this.project))
})
describe('when downloading for embedding', function () {
beforeEach(function () {
this.CompileController.proxyToClsi = sinon.stub()
this.RateLimiter.addCount.callsArgWith(1, null, true)
return this.CompileController.downloadPdf(this.req, this.res, this.next)
})
it('should look up the project', function () {
return this.ProjectGetter.getProject
.calledWith(this.project_id, { name: 1 })
.should.equal(true)
})
it('should set the content-type of the response to application/pdf', function () {
return this.res.contentType
.calledWith('application/pdf')
.should.equal(true)
})
it('should set the content-disposition header with a safe version of the project name', function () {
return this.res.setContentDisposition
.calledWith('', { filename: 'test_nam_.pdf' })
.should.equal(true)
})
it('should increment the pdf-downloads metric', function () {
return this.Metrics.inc.calledWith('pdf-downloads').should.equal(true)
})
it('should proxy the PDF from the CLSI', function () {
return this.CompileController.proxyToClsi
.calledWith(
this.project_id,
`/project/${this.project_id}/user/${this.user_id}/output/output.pdf`,
this.req,
this.res,
this.next
)
.should.equal(true)
})
})
describe('when the a build-id is provided', function () {
beforeEach(function () {
this.req.params.build_id = this.buildId = '1234-5678'
this.CompileController.proxyToClsi = sinon.stub()
this.RateLimiter.addCount.callsArgWith(1, null, true)
return this.CompileController.downloadPdf(this.req, this.res, this.next)
})
it('should proxy the PDF from the CLSI, with a build-id', function () {
return this.CompileController.proxyToClsi
.calledWith(
this.project_id,
`/project/${this.project_id}/user/${this.user_id}/build/${this.buildId}/output/output.pdf`,
this.req,
this.res,
this.next
)
.should.equal(true)
})
})
describe('when the pdf is not going to be used in pdfjs viewer', function () {
it('should check the rate limiter when pdfng is not set', function (done) {
this.req.query = {}
this.RateLimiter.addCount.callsArgWith(1, null, true)
this.CompileController.proxyToClsi = (project_id, url) => {
this.RateLimiter.addCount.args[0][0].throttle.should.equal(1000)
return done()
}
return this.CompileController.downloadPdf(this.req, this.res)
})
it('should check the rate limiter when pdfng is false', function (done) {
this.req.query = { pdfng: false }
this.RateLimiter.addCount.callsArgWith(1, null, true)
this.CompileController.proxyToClsi = (project_id, url) => {
this.RateLimiter.addCount.args[0][0].throttle.should.equal(1000)
return done()
}
return this.CompileController.downloadPdf(this.req, this.res)
})
})
})
describe('getFileFromClsiWithoutUser', function () {
beforeEach(function () {
this.submission_id = 'sub-1234'
this.build_id = 123456
this.file = 'project.pdf'
this.req.params = {
submission_id: this.submission_id,
build_id: this.build_id,
file: this.file,
}
this.req.body = {}
this.expected_url = `/project/${this.submission_id}/build/${this.build_id}/output/${this.file}`
return (this.CompileController.proxyToClsiWithLimits = sinon.stub())
})
describe('without limits specified', function () {
beforeEach(function () {
return this.CompileController.getFileFromClsiWithoutUser(
this.req,
this.res,
this.next
)
})
it('should proxy to CLSI with correct URL and default limits', function () {
return this.CompileController.proxyToClsiWithLimits
.calledWith(this.submission_id, this.expected_url, {
compileGroup: 'standard',
})
.should.equal(true)
})
})
describe('with limits specified', function () {
beforeEach(function () {
this.req.body = { compileTimeout: 600, compileGroup: 'special' }
return this.CompileController.getFileFromClsiWithoutUser(
this.req,
this.res,
this.next
)
})
it('should proxy to CLSI with correct URL and specified limits', function () {
return this.CompileController.proxyToClsiWithLimits
.calledWith(this.submission_id, this.expected_url, {
compileGroup: 'special',
})
.should.equal(true)
})
})
})
describe('proxySyncCode', function () {
let file, line, column, imageName
beforeEach(function (done) {
this.req.params = { Project_id: this.project_id }
file = 'main.tex'
line = String(Date.now())
column = String(Date.now() + 1)
this.req.query = { file, line, column }
imageName = 'foo/bar:tag-0'
this.ProjectGetter.getProject = sinon.stub().yields(null, { imageName })
this.next.callsFake(done)
this.res.callback = done
this.CompileController.proxyToClsi = sinon.stub().callsFake(() => done())
this.CompileController.proxySyncCode(this.req, this.res, this.next)
})
it('should proxy the request with an imageName', function () {
expect(this.CompileController.proxyToClsi).to.have.been.calledWith(
this.project_id,
{
url: `/project/${this.project_id}/user/${this.user_id}/sync/code`,
qs: { file, line, column, imageName },
},
this.req,
this.res,
this.next
)
})
})
describe('proxySyncPdf', function () {
let page, h, v, imageName
beforeEach(function (done) {
this.req.params = { Project_id: this.project_id }
page = String(Date.now())
h = String(Math.random())
v = String(Math.random())
this.req.query = { page, h, v }
imageName = 'foo/bar:tag-1'
this.ProjectGetter.getProject = sinon.stub().yields(null, { imageName })
this.next.callsFake(done)
this.res.callback = done
this.CompileController.proxyToClsi = sinon.stub().callsFake(() => done())
this.CompileController.proxySyncPdf(this.req, this.res, this.next)
})
it('should proxy the request with an imageName', function () {
expect(this.CompileController.proxyToClsi).to.have.been.calledWith(
this.project_id,
{
url: `/project/${this.project_id}/user/${this.user_id}/sync/pdf`,
qs: { page, h, v, imageName },
},
this.req,
this.res,
this.next
)
})
})
describe('proxyToClsi', function () {
beforeEach(function () {
this.request.returns(
(this.proxy = {
pipe: sinon.stub(),
on: sinon.stub(),
})
)
this.upstream = {
statusCode: 204,
headers: { mock: 'header' },
}
this.req.method = 'mock-method'
return (this.req.headers = {
Mock: 'Headers',
Range: '123-456',
'If-Range': 'abcdef',
'If-Modified-Since': 'Mon, 15 Dec 2014 15:23:56 GMT',
})
})
describe('old pdf viewer', function () {
describe('user with standard priority', function () {
beforeEach(function () {
this.CompileManager.getProjectCompileLimits = sinon
.stub()
.callsArgWith(1, null, { compileGroup: 'standard' })
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
it('should open a request to the CLSI', function () {
return this.request
.calledWith({
jar: this.jar,
method: this.req.method,
url: `${this.settings.apis.clsi.url}${this.url}`,
timeout: 60 * 1000,
})
.should.equal(true)
})
it('should pass the request on to the client', function () {
return this.proxy.pipe.calledWith(this.res).should.equal(true)
})
it('should bind an error handle to the request proxy', function () {
return this.proxy.on.calledWith('error').should.equal(true)
})
})
describe('user with priority compile', function () {
beforeEach(function () {
this.CompileManager.getProjectCompileLimits = sinon
.stub()
.callsArgWith(1, null, { compileGroup: 'priority' })
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
})
describe('user with standard priority via query string', function () {
beforeEach(function () {
this.req.query = { compileGroup: 'standard' }
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
it('should open a request to the CLSI', function () {
return this.request
.calledWith({
jar: this.jar,
method: this.req.method,
url: `${this.settings.apis.clsi.url}${this.url}`,
timeout: 60 * 1000,
})
.should.equal(true)
})
it('should pass the request on to the client', function () {
return this.proxy.pipe.calledWith(this.res).should.equal(true)
})
it('should bind an error handle to the request proxy', function () {
return this.proxy.on.calledWith('error').should.equal(true)
})
})
describe('user with non-existent priority via query string', function () {
beforeEach(function () {
this.req.query = { compileGroup: 'foobar' }
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
it('should proxy to the standard url', function () {
return this.request
.calledWith({
jar: this.jar,
method: this.req.method,
url: `${this.settings.apis.clsi.url}${this.url}`,
timeout: 60 * 1000,
})
.should.equal(true)
})
})
describe('user with build parameter via query string', function () {
beforeEach(function () {
this.CompileManager.getProjectCompileLimits = sinon
.stub()
.callsArgWith(1, null, { compileGroup: 'standard' })
this.req.query = { build: 1234 }
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
it('should proxy to the standard url without the build parameter', function () {
return this.request
.calledWith({
jar: this.jar,
method: this.req.method,
url: `${this.settings.apis.clsi.url}${this.url}`,
timeout: 60 * 1000,
})
.should.equal(true)
})
})
})
describe('new pdf viewer', function () {
beforeEach(function () {
return (this.req.query = { pdfng: true })
})
describe('user with standard priority', function () {
beforeEach(function () {
this.CompileManager.getProjectCompileLimits = sinon
.stub()
.callsArgWith(1, null, { compileGroup: 'standard' })
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
it('should open a request to the CLSI', function () {
return this.request
.calledWith({
jar: this.jar,
method: this.req.method,
url: `${this.settings.apis.clsi.url}${this.url}`,
timeout: 60 * 1000,
headers: {
Range: '123-456',
'If-Range': 'abcdef',
'If-Modified-Since': 'Mon, 15 Dec 2014 15:23:56 GMT',
},
})
.should.equal(true)
})
it('should pass the request on to the client', function () {
return this.proxy.pipe.calledWith(this.res).should.equal(true)
})
it('should bind an error handle to the request proxy', function () {
return this.proxy.on.calledWith('error').should.equal(true)
})
})
describe('user with build parameter via query string', function () {
beforeEach(function () {
this.CompileManager.getProjectCompileLimits = sinon
.stub()
.callsArgWith(1, null, { compileGroup: 'standard' })
this.req.query = { build: 1234, pdfng: true }
return this.CompileController.proxyToClsi(
this.project_id,
(this.url = '/test'),
this.req,
this.res,
this.next
)
})
it('should proxy to the standard url with the build parameter', function () {
return this.request
.calledWith({
jar: this.jar,
method: this.req.method,
qs: { build: 1234 },
url: `${this.settings.apis.clsi.url}${this.url}`,
timeout: 60 * 1000,
headers: {
Range: '123-456',
'If-Range': 'abcdef',
'If-Modified-Since': 'Mon, 15 Dec 2014 15:23:56 GMT',
},
})
.should.equal(true)
})
})
})
})
describe('deleteAuxFiles', function () {
beforeEach(function () {
this.CompileManager.deleteAuxFiles = sinon.stub().yields()
this.req.params = { Project_id: this.project_id }
this.req.query = { clsiserverid: 'node-1' }
this.res.sendStatus = sinon.stub()
return this.CompileController.deleteAuxFiles(
this.req,
this.res,
this.next
)
})
it('should proxy to the CLSI', function () {
return this.CompileManager.deleteAuxFiles
.calledWith(this.project_id, this.user_id, 'node-1')
.should.equal(true)
})
it('should return a 200', function () {
return this.res.sendStatus.calledWith(200).should.equal(true)
})
})
describe('compileAndDownloadPdf', function () {
beforeEach(function () {
this.req = {
params: {
project_id: this.project_id,
},
}
this.CompileManager.compile.callsArgWith(3)
this.CompileController.proxyToClsi = sinon.stub()
return (this.res = { send: () => {} })
})
it('should call compile in the compile manager', function (done) {
this.CompileController.compileAndDownloadPdf(this.req, this.res)
this.CompileManager.compile.calledWith(this.project_id).should.equal(true)
return done()
})
it('should proxy the res to the clsi with correct url', function (done) {
this.CompileController.compileAndDownloadPdf(this.req, this.res)
sinon.assert.calledWith(
this.CompileController.proxyToClsi,
this.project_id,
`/project/${this.project_id}/output/output.pdf`,
this.req,
this.res
)
this.CompileController.proxyToClsi
.calledWith(
this.project_id,
`/project/${this.project_id}/output/output.pdf`,
this.req,
this.res
)
.should.equal(true)
return done()
})
})
describe('wordCount', function () {
beforeEach(function () {
this.CompileManager.wordCount = sinon
.stub()
.yields(null, { content: 'body' })
this.req.params = { Project_id: this.project_id }
this.req.query = { clsiserverid: 'node-42' }
this.res.send = sinon.stub()
this.res.contentType = sinon.stub()
return this.CompileController.wordCount(this.req, this.res, this.next)
})
it('should proxy to the CLSI', function () {
return this.CompileManager.wordCount
.calledWith(this.project_id, this.user_id, false, 'node-42')
.should.equal(true)
})
it('should return a 200 and body', function () {
return this.res.send.calledWith({ content: 'body' }).should.equal(true)
})
})
})
| overleaf/web/test/unit/src/Compile/CompileControllerTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Compile/CompileControllerTests.js",
"repo_id": "overleaf",
"token_count": 11757
} | 620 |
const SandboxedModule = require('sandboxed-module')
const path = require('path')
const sinon = require('sinon')
const { expect } = require('chai')
const MODULE_PATH = path.join(
__dirname,
'../../../../app/src/Features/Email/EmailHandler'
)
describe('EmailHandler', function () {
beforeEach(function () {
this.html = '<html>hello</html>'
this.Settings = { email: {} }
this.EmailBuilder = {
buildEmail: sinon.stub().returns({ html: this.html }),
}
this.EmailSender = {
promises: {
sendEmail: sinon.stub().resolves(),
},
}
this.EmailHandler = SandboxedModule.require(MODULE_PATH, {
requires: {
'./EmailBuilder': this.EmailBuilder,
'./EmailSender': this.EmailSender,
'@overleaf/settings': this.Settings,
},
})
})
describe('send email', function () {
it('should use the correct options', async function () {
const opts = { to: 'bob@bob.com' }
await this.EmailHandler.promises.sendEmail('welcome', opts)
expect(this.EmailSender.promises.sendEmail).to.have.been.calledWithMatch({
html: this.html,
})
})
it('should return the error', async function () {
this.EmailSender.promises.sendEmail.rejects(new Error('boom'))
const opts = {
to: 'bob@bob.com',
subject: 'hello bob',
}
await expect(this.EmailHandler.promises.sendEmail('welcome', opts)).to.be
.rejected
})
it('should not send an email if lifecycle is not enabled', async function () {
this.Settings.email.lifecycle = false
this.EmailBuilder.buildEmail.returns({ type: 'lifecycle' })
await this.EmailHandler.promises.sendEmail('welcome', {})
expect(this.EmailSender.promises.sendEmail).not.to.have.been.called
})
it('should send an email if lifecycle is not enabled but the type is notification', async function () {
this.Settings.email.lifecycle = false
this.EmailBuilder.buildEmail.returns({ type: 'notification' })
const opts = { to: 'bob@bob.com' }
await this.EmailHandler.promises.sendEmail('welcome', opts)
expect(this.EmailSender.promises.sendEmail).to.have.been.called
})
it('should send lifecycle email if it is enabled', async function () {
this.Settings.email.lifecycle = true
this.EmailBuilder.buildEmail.returns({ type: 'lifecycle' })
const opts = { to: 'bob@bob.com' }
await this.EmailHandler.promises.sendEmail('welcome', opts)
expect(this.EmailSender.promises.sendEmail).to.have.been.called
})
describe('with plain-text email content', function () {
beforeEach(function () {
this.text = 'hello there'
})
it('should pass along the text field', async function () {
this.EmailBuilder.buildEmail.returns({
html: this.html,
text: this.text,
})
const opts = { to: 'bob@bob.com' }
await this.EmailHandler.promises.sendEmail('welcome', opts)
expect(
this.EmailSender.promises.sendEmail
).to.have.been.calledWithMatch({
html: this.html,
text: this.text,
})
})
})
})
})
| overleaf/web/test/unit/src/Email/EmailHandlerTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Email/EmailHandlerTests.js",
"repo_id": "overleaf",
"token_count": 1286
} | 621 |
/* eslint-disable
max-len,
no-return-assign,
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const SandboxedModule = require('sandboxed-module')
const assert = require('assert')
const { expect } = require('chai')
const sinon = require('sinon')
const modulePath = require('path').join(
__dirname,
'../../../../app/src/Features/History/RestoreManager'
)
const Errors = require('../../../../app/src/Features/Errors/Errors')
const tk = require('timekeeper')
const moment = require('moment')
describe('RestoreManager', function () {
beforeEach(function () {
tk.freeze(Date.now()) // freeze the time for these tests
this.RestoreManager = SandboxedModule.require(modulePath, {
requires: {
'@overleaf/settings': {},
'../../infrastructure/FileWriter': (this.FileWriter = {}),
'../Uploads/FileSystemImportManager': (this.FileSystemImportManager = {}),
'../Project/ProjectEntityHandler': (this.ProjectEntityHandler = {}),
'../Editor/EditorController': (this.EditorController = {}),
},
})
this.user_id = 'mock-user-id'
this.project_id = 'mock-project-id'
this.version = 42
return (this.callback = sinon.stub())
})
afterEach(function () {
return tk.reset()
})
describe('restoreFileFromV2', function () {
beforeEach(function () {
this.RestoreManager._writeFileVersionToDisk = sinon
.stub()
.yields(null, (this.fsPath = '/tmp/path/on/disk'))
this.RestoreManager._findOrCreateFolder = sinon
.stub()
.yields(null, (this.folder_id = 'mock-folder-id'))
return (this.FileSystemImportManager.addEntity = sinon
.stub()
.yields(null, (this.entity = 'mock-entity')))
})
describe('with a file not in a folder', function () {
beforeEach(function () {
this.pathname = 'foo.tex'
return this.RestoreManager.restoreFileFromV2(
this.user_id,
this.project_id,
this.version,
this.pathname,
this.callback
)
})
it('should write the file version to disk', function () {
return this.RestoreManager._writeFileVersionToDisk
.calledWith(this.project_id, this.version, this.pathname)
.should.equal(true)
})
it('should find the root folder', function () {
return this.RestoreManager._findOrCreateFolder
.calledWith(this.project_id, '')
.should.equal(true)
})
it('should add the entity', function () {
return this.FileSystemImportManager.addEntity
.calledWith(
this.user_id,
this.project_id,
this.folder_id,
'foo.tex',
this.fsPath,
false
)
.should.equal(true)
})
it('should call the callback with the entity', function () {
return this.callback.calledWith(null, this.entity).should.equal(true)
})
})
describe('with a file in a folder', function () {
beforeEach(function () {
this.pathname = 'foo/bar.tex'
return this.RestoreManager.restoreFileFromV2(
this.user_id,
this.project_id,
this.version,
this.pathname,
this.callback
)
})
it('should find the folder', function () {
return this.RestoreManager._findOrCreateFolder
.calledWith(this.project_id, 'foo')
.should.equal(true)
})
it('should add the entity by its basename', function () {
return this.FileSystemImportManager.addEntity
.calledWith(
this.user_id,
this.project_id,
this.folder_id,
'bar.tex',
this.fsPath,
false
)
.should.equal(true)
})
})
})
describe('_findOrCreateFolder', function () {
beforeEach(function () {
this.EditorController.mkdirp = sinon
.stub()
.yields(null, [], { _id: (this.folder_id = 'mock-folder-id') })
return this.RestoreManager._findOrCreateFolder(
this.project_id,
'folder/name',
this.callback
)
})
it('should look up or create the folder', function () {
return this.EditorController.mkdirp
.calledWith(this.project_id, 'folder/name')
.should.equal(true)
})
it('should return the folder_id', function () {
return this.callback.calledWith(null, this.folder_id).should.equal(true)
})
})
describe('_addEntityWithUniqueName', function () {
beforeEach(function () {
this.addEntityWithName = sinon.stub()
return (this.name = 'foo.tex')
})
describe('with a valid name', function () {
beforeEach(function () {
this.addEntityWithName.yields(null, (this.entity = 'mock-entity'))
return this.RestoreManager._addEntityWithUniqueName(
this.addEntityWithName,
this.name,
this.callback
)
})
it('should add the entity', function () {
return this.addEntityWithName.calledWith(this.name).should.equal(true)
})
it('should return the entity', function () {
return this.callback.calledWith(null, this.entity).should.equal(true)
})
})
describe('with an invalid name', function () {
beforeEach(function () {
this.addEntityWithName
.onFirstCall()
.yields(new Errors.InvalidNameError())
this.addEntityWithName
.onSecondCall()
.yields(null, (this.entity = 'mock-entity'))
return this.RestoreManager._addEntityWithUniqueName(
this.addEntityWithName,
this.name,
this.callback
)
})
it('should try to add the entity with its original name', function () {
return this.addEntityWithName.calledWith('foo.tex').should.equal(true)
})
it('should try to add the entity with a unique name', function () {
const date = moment(new Date()).format('Do MMM YY H:mm:ss')
return this.addEntityWithName
.calledWith(`foo (Restored on ${date}).tex`)
.should.equal(true)
})
it('should return the entity', function () {
return this.callback.calledWith(null, this.entity).should.equal(true)
})
})
})
})
| overleaf/web/test/unit/src/History/RestoreManagerTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/History/RestoreManagerTests.js",
"repo_id": "overleaf",
"token_count": 2809
} | 622 |
/* eslint-disable
max-len,
mocha/no-identical-title,
no-return-assign,
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const sinon = require('sinon')
const modulePath = '../../../../app/src/Features/Project/DocLinesComparitor.js'
const SandboxedModule = require('sandboxed-module')
describe('doc lines comparitor', function () {
beforeEach(function () {
return (this.comparitor = SandboxedModule.require(modulePath, {}))
})
it('should return true when the lines are the same', function () {
const lines1 = ['hello', 'world']
const lines2 = ['hello', 'world']
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(true)
})
it('should return false when the lines are different', function () {
const lines1 = ['hello', 'world']
const lines2 = ['diff', 'world']
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
it('should return false when the lines are different', function () {
const lines1 = ['hello', 'world']
const lines2 = ['hello', 'wrld']
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
it('should return true when the lines are same', function () {
const lines1 = ['hello', 'world']
const lines2 = ['hello', 'world']
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(true)
})
it('should return false if the doc lines are different in length', function () {
const lines1 = ['hello', 'world']
const lines2 = ['hello', 'world', 'please']
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
it('should return false if the first array is undefined', function () {
const lines1 = undefined
const lines2 = ['hello', 'world']
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
it('should return false if the second array is undefined', function () {
const lines1 = ['hello']
const lines2 = undefined
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
it('should return false if the second array is not an array', function () {
const lines1 = ['hello']
const lines2 = ''
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
it('should return true when comparing equal orchard docs', function () {
const lines1 = [{ text: 'hello world' }]
const lines2 = [{ text: 'hello world' }]
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(true)
})
it('should return false when comparing different orchard docs', function () {
const lines1 = [{ text: 'goodbye world' }]
const lines2 = [{ text: 'hello world' }]
const result = this.comparitor.areSame(lines1, lines2)
return result.should.equal(false)
})
})
| overleaf/web/test/unit/src/Project/DocLinesComparitorTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Project/DocLinesComparitorTests.js",
"repo_id": "overleaf",
"token_count": 1070
} | 623 |
const { expect } = require('chai')
const modulePath = '../../../../app/src/Features/Project/ProjectLocator'
const SandboxedModule = require('sandboxed-module')
const sinon = require('sinon')
const Errors = require('../../../../app/src/Features/Errors/Errors')
const project = { _id: '1234566', rootFolder: [] }
class Project {}
const rootDoc = { name: 'rootDoc', _id: 'das239djd' }
const doc1 = { name: 'otherDoc.txt', _id: 'dsad2ddd' }
const doc2 = { name: 'docname.txt', _id: 'dsad2ddddd' }
const file1 = { name: 'file1', _id: 'dsa9lkdsad' }
const subSubFile = { name: 'subSubFile', _id: 'd1d2dk' }
const subSubDoc = { name: 'subdoc.txt', _id: '321dmdwi' }
const secondSubFolder = {
name: 'secondSubFolder',
_id: 'dsa3e23',
docs: [subSubDoc],
fileRefs: [subSubFile],
folders: [],
}
const subFolder = {
name: 'subFolder',
_id: 'dsadsa93',
folders: [secondSubFolder, null],
docs: [],
fileRefs: [],
}
const subFolder1 = { name: 'subFolder1', _id: '123asdjoij' }
const rootFolder = {
_id: '123sdskd',
docs: [doc1, doc2, null, rootDoc],
fileRefs: [file1],
folders: [subFolder1, subFolder],
}
project.rootFolder[0] = rootFolder
project.rootDoc_id = rootDoc._id
describe('ProjectLocator', function () {
beforeEach(function () {
Project.findById = (projectId, callback) => {
callback(null, project)
}
this.ProjectGetter = {
getProject: sinon.stub().callsArgWith(2, null, project),
}
this.ProjectHelper = {
isArchived: sinon.stub(),
isTrashed: sinon.stub(),
isArchivedOrTrashed: sinon.stub(),
}
this.locator = SandboxedModule.require(modulePath, {
requires: {
'../../models/Project': { Project },
'../../models/User': { User: this.User },
'./ProjectGetter': this.ProjectGetter,
'./ProjectHelper': this.ProjectHelper,
},
})
})
describe('finding a doc', function () {
it('finds one at the root level', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: doc2._id, type: 'docs' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(doc2._id)
path.fileSystem.should.equal(`/${doc2.name}`)
parentFolder._id.should.equal(project.rootFolder[0]._id)
path.mongo.should.equal('rootFolder.0.docs.1')
done()
}
)
})
it('when it is nested', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: subSubDoc._id, type: 'doc' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
expect(foundElement._id).to.equal(subSubDoc._id)
path.fileSystem.should.equal(
`/${subFolder.name}/${secondSubFolder.name}/${subSubDoc.name}`
)
parentFolder._id.should.equal(secondSubFolder._id)
path.mongo.should.equal('rootFolder.0.folders.1.folders.0.docs.0')
done()
}
)
})
it('should give error if element could not be found', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: 'ddsd432nj42', type: 'docs' },
(err, foundElement, path, parentFolder) => {
expect(err).to.be.instanceOf(Errors.NotFoundError)
expect(err).to.have.property('message', 'entity not found')
done()
}
)
})
})
describe('finding a folder', function () {
it('should return root folder when looking for root folder', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: rootFolder._id, type: 'folder' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(rootFolder._id)
done()
}
)
})
it('when at root', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: subFolder._id, type: 'folder' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(subFolder._id)
path.fileSystem.should.equal(`/${subFolder.name}`)
parentFolder._id.should.equal(rootFolder._id)
path.mongo.should.equal('rootFolder.0.folders.1')
done()
}
)
})
it('when deeply nested', function (done) {
this.locator.findElement(
{
project_id: project._id,
element_id: secondSubFolder._id,
type: 'folder',
},
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(secondSubFolder._id)
path.fileSystem.should.equal(
`/${subFolder.name}/${secondSubFolder.name}`
)
parentFolder._id.should.equal(subFolder._id)
path.mongo.should.equal('rootFolder.0.folders.1.folders.0')
done()
}
)
})
})
describe('finding a file', function () {
it('when at root', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: file1._id, type: 'fileRefs' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(file1._id)
path.fileSystem.should.equal(`/${file1.name}`)
parentFolder._id.should.equal(rootFolder._id)
path.mongo.should.equal('rootFolder.0.fileRefs.0')
done()
}
)
})
it('when deeply nested', function (done) {
this.locator.findElement(
{
project_id: project._id,
element_id: subSubFile._id,
type: 'fileRefs',
},
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(subSubFile._id)
path.fileSystem.should.equal(
`/${subFolder.name}/${secondSubFolder.name}/${subSubFile.name}`
)
parentFolder._id.should.equal(secondSubFolder._id)
path.mongo.should.equal('rootFolder.0.folders.1.folders.0.fileRefs.0')
done()
}
)
})
})
describe('finding an element with wrong element type', function () {
it('should add an s onto the element type', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: subSubDoc._id, type: 'doc' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(subSubDoc._id)
done()
}
)
})
it('should convert file to fileRefs', function (done) {
this.locator.findElement(
{ project_id: project._id, element_id: file1._id, type: 'fileRefs' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(file1._id)
done()
}
)
})
})
describe('should be able to take actual project as well as id', function () {
const doc3 = {
_id: '123dsdj3',
name: 'doc3',
}
const rootFolder2 = {
_id: '123sddedskd',
docs: [doc3],
}
const project2 = {
_id: '1234566',
rootFolder: [rootFolder2],
}
it('should find doc in project', function (done) {
this.locator.findElement(
{ project: project2, element_id: doc3._id, type: 'docs' },
(err, foundElement, path, parentFolder) => {
if (err != null) {
return done(err)
}
foundElement._id.should.equal(doc3._id)
path.fileSystem.should.equal(`/${doc3.name}`)
parentFolder._id.should.equal(project2.rootFolder[0]._id)
path.mongo.should.equal('rootFolder.0.docs.0')
done()
}
)
})
})
describe('finding root doc', function () {
it('should return root doc when passed project', function (done) {
this.locator.findRootDoc(project, (err, doc) => {
if (err != null) {
return done(err)
}
doc._id.should.equal(rootDoc._id)
done()
})
})
it('should return root doc when passed project_id', function (done) {
this.locator.findRootDoc(project._id, (err, doc) => {
if (err != null) {
return done(err)
}
doc._id.should.equal(rootDoc._id)
done()
})
})
it('should return null when the project has no rootDoc', function (done) {
project.rootDoc_id = null
this.locator.findRootDoc(project, (err, doc) => {
if (err != null) {
return done(err)
}
expect(doc).to.equal(null)
done()
})
})
it('should return null when the rootDoc_id no longer exists', function (done) {
project.rootDoc_id = 'doesntexist'
this.locator.findRootDoc(project, (err, doc) => {
if (err != null) {
return done(err)
}
expect(doc).to.equal(null)
done()
})
})
})
describe('findElementByPath', function () {
it('should take a doc path and return the element for a root level document', function (done) {
const path = `${doc1.name}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(doc1)
expect(type).to.equal('doc')
done()
}
)
})
it('should take a doc path and return the element for a root level document with a starting slash', function (done) {
const path = `/${doc1.name}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(doc1)
expect(type).to.equal('doc')
done()
}
)
})
it('should take a doc path and return the element for a nested document', function (done) {
const path = `${subFolder.name}/${secondSubFolder.name}/${subSubDoc.name}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(subSubDoc)
expect(type).to.equal('doc')
done()
}
)
})
it('should take a file path and return the element for a root level document', function (done) {
const path = `${file1.name}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(file1)
expect(type).to.equal('file')
done()
}
)
})
it('should take a file path and return the element for a nested document', function (done) {
const path = `${subFolder.name}/${secondSubFolder.name}/${subSubFile.name}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(subSubFile)
expect(type).to.equal('file')
done()
}
)
})
it('should take a file path and return the element for a nested document case insenstive', function (done) {
const path = `${subFolder.name.toUpperCase()}/${secondSubFolder.name.toUpperCase()}/${subSubFile.name.toUpperCase()}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(subSubFile)
expect(type).to.equal('file')
done()
}
)
})
it('should take a file path and return the element for a nested folder', function (done) {
const path = `${subFolder.name}/${secondSubFolder.name}`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(secondSubFolder)
expect(type).to.equal('folder')
done()
}
)
})
it('should take a file path and return the root folder', function (done) {
const path = '/'
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
element.should.deep.equal(rootFolder)
expect(type).to.equal('folder')
done()
}
)
})
it('should return an error if the file can not be found inside know folder', function (done) {
const path = `${subFolder.name}/${secondSubFolder.name}/exist.txt`
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
err.should.not.equal(undefined)
expect(element).to.be.undefined
expect(type).to.be.undefined
done()
}
)
})
it('should return an error if the file can not be found inside unknown folder', function (done) {
const path = 'this/does/not/exist.txt'
this.locator.findElementByPath(
{ project, path },
(err, element, type) => {
err.should.not.equal(undefined)
expect(element).to.be.undefined
expect(type).to.be.undefined
done()
}
)
})
describe('where duplicate folder exists', function () {
beforeEach(function () {
this.duplicateFolder = {
name: 'duplicate1',
_id: '1234',
folders: [
{
name: '1',
docs: [{ name: 'main.tex', _id: '456' }],
folders: [],
fileRefs: [],
},
],
docs: [(this.doc = { name: 'main.tex', _id: '456' })],
fileRefs: [],
}
this.project = {
rootFolder: [
{
folders: [this.duplicateFolder, this.duplicateFolder],
fileRefs: [],
docs: [],
},
],
}
})
it('should not call the callback more than once', function (done) {
const path = `${this.duplicateFolder.name}/${this.doc.name}`
this.locator.findElementByPath({ project: this.project, path }, () =>
done()
)
}) // mocha will throw exception if done called multiple times
it('should not call the callback more than once when the path is longer than 1 level below the duplicate level', function (done) {
const path = `${this.duplicateFolder.name}/1/main.tex`
this.locator.findElementByPath({ project: this.project, path }, () =>
done()
)
})
}) // mocha will throw exception if done called multiple times
describe('with a null doc', function () {
beforeEach(function () {
this.project = {
rootFolder: [
{
folders: [],
fileRefs: [],
docs: [{ name: 'main.tex' }, null, { name: 'other.tex' }],
},
],
}
})
it('should not crash with a null', function (done) {
const path = '/other.tex'
this.locator.findElementByPath(
{ project: this.project, path },
(err, element) => {
if (err != null) {
return done(err)
}
element.name.should.equal('other.tex')
done()
}
)
})
})
describe('with a null project', function () {
beforeEach(function () {
this.ProjectGetter = { getProject: sinon.stub().callsArg(2) }
})
it('should not crash with a null', function (done) {
const path = '/other.tex'
this.locator.findElementByPath(
{ project_id: project._id, path },
(err, element) => {
expect(err).to.exist
done()
}
)
})
})
describe('with a project_id', function () {
it('should take a doc path and return the element for a root level document', function (done) {
const path = `${doc1.name}`
this.locator.findElementByPath(
{ project_id: project._id, path },
(err, element, type) => {
if (err != null) {
return done(err)
}
this.ProjectGetter.getProject
.calledWith(project._id, { rootFolder: true, rootDoc_id: true })
.should.equal(true)
element.should.deep.equal(doc1)
expect(type).to.equal('doc')
done()
}
)
})
})
})
})
| overleaf/web/test/unit/src/Project/ProjectLocatorTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Project/ProjectLocatorTests.js",
"repo_id": "overleaf",
"token_count": 8128
} | 624 |
/* eslint-disable
max-len,
no-return-assign,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS103: Rewrite code to no longer use __guard__
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const SandboxedModule = require('sandboxed-module')
const sinon = require('sinon')
const modulePath = require('path').join(
__dirname,
'../../../../app/src/Features/Security/RateLimiterMiddleware'
)
describe('RateLimiterMiddleware', function () {
beforeEach(function () {
this.SessionManager = {
getLoggedInUserId: () => {
return __guard__(
__guard__(
this.req != null ? this.req.session : undefined,
x1 => x1.user
),
x => x._id
)
},
}
this.RateLimiterMiddleware = SandboxedModule.require(modulePath, {
requires: {
'@overleaf/settings': (this.settings = {}),
'../../infrastructure/RateLimiter': (this.RateLimiter = {}),
'./LoginRateLimiter': {},
'../Authentication/SessionManager': this.SessionManager,
},
})
this.req = { params: {} }
this.res = {
status: sinon.stub(),
write: sinon.stub(),
end: sinon.stub(),
}
return (this.next = sinon.stub())
})
describe('rateLimit', function () {
beforeEach(function () {
this.rateLimiter = this.RateLimiterMiddleware.rateLimit({
endpointName: 'test-endpoint',
params: ['project_id', 'doc_id'],
timeInterval: 42,
maxRequests: 12,
})
return (this.req.params = {
project_id: (this.project_id = 'project-id'),
doc_id: (this.doc_id = 'doc-id'),
})
})
describe('when there is no session', function () {
beforeEach(function () {
this.RateLimiter.addCount = sinon.stub().callsArgWith(1, null, true)
this.req.ip = this.ip = '1.2.3.4'
return this.rateLimiter(this.req, this.res, this.next)
})
it('should call the rate limiter backend with the ip address', function () {
return this.RateLimiter.addCount
.calledWith({
endpointName: 'test-endpoint',
timeInterval: 42,
throttle: 12,
subjectName: `${this.project_id}:${this.doc_id}:${this.ip}`,
})
.should.equal(true)
})
it('should pass on to next()', function () {})
})
describe('when smoke test user', function () {
beforeEach(function () {
this.req.session = {
user: {
_id: (this.user_id = 'smoke-test-user-id'),
},
}
this.settings.smokeTest = { userId: this.user_id }
this.RateLimiter.addCount = sinon.stub().callsArgWith(1, null, true)
return this.rateLimiter(this.req, this.res, this.next)
})
it('should not call the rate limiter backend with the user_id', function () {
this.RateLimiter.addCount
.calledWith({
endpointName: 'test-endpoint',
timeInterval: 42,
throttle: 12,
subjectName: `${this.project_id}:${this.doc_id}:${this.user_id}`,
})
.should.equal(false)
this.RateLimiter.addCount.callCount.should.equal(0)
})
it('should pass on to next()', function () {
return this.next.called.should.equal(true)
})
})
describe('when under the rate limit with logged in user', function () {
beforeEach(function () {
this.req.session = {
user: {
_id: (this.user_id = 'user-id'),
},
}
this.RateLimiter.addCount = sinon.stub().callsArgWith(1, null, true)
return this.rateLimiter(this.req, this.res, this.next)
})
it('should call the rate limiter backend with the user_id', function () {
return this.RateLimiter.addCount
.calledWith({
endpointName: 'test-endpoint',
timeInterval: 42,
throttle: 12,
subjectName: `${this.project_id}:${this.doc_id}:${this.user_id}`,
})
.should.equal(true)
})
it('should pass on to next()', function () {
return this.next.called.should.equal(true)
})
})
describe('when under the rate limit with anonymous user', function () {
beforeEach(function () {
this.req.ip = this.ip = '1.2.3.4'
this.RateLimiter.addCount = sinon.stub().callsArgWith(1, null, true)
return this.rateLimiter(this.req, this.res, this.next)
})
it('should call the rate limiter backend with the ip address', function () {
return this.RateLimiter.addCount
.calledWith({
endpointName: 'test-endpoint',
timeInterval: 42,
throttle: 12,
subjectName: `${this.project_id}:${this.doc_id}:${this.ip}`,
})
.should.equal(true)
})
it('should pass on to next()', function () {
return this.next.called.should.equal(true)
})
})
describe('when over the rate limit', function () {
beforeEach(function () {
this.req.session = {
user: {
_id: (this.user_id = 'user-id'),
},
}
this.RateLimiter.addCount = sinon.stub().callsArgWith(1, null, false)
return this.rateLimiter(this.req, this.res, this.next)
})
it('should return a 429', function () {
this.res.status.calledWith(429).should.equal(true)
return this.res.end.called.should.equal(true)
})
it('should not continue', function () {
return this.next.called.should.equal(false)
})
it('should log a warning', function () {
return this.logger.warn
.calledWith(
{
endpointName: 'test-endpoint',
timeInterval: 42,
throttle: 12,
subjectName: `${this.project_id}:${this.doc_id}:${this.user_id}`,
},
'rate limit exceeded'
)
.should.equal(true)
})
})
})
})
function __guard__(value, transform) {
return typeof value !== 'undefined' && value !== null
? transform(value)
: undefined
}
| overleaf/web/test/unit/src/Security/RateLimiterMiddlewareTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Security/RateLimiterMiddlewareTests.js",
"repo_id": "overleaf",
"token_count": 2893
} | 625 |
const SandboxedModule = require('sandboxed-module')
const { expect } = require('chai')
const modulePath =
'../../../../app/src/Features/Subscription/SubscriptionHelper'
const plans = {
expensive: {
planCode: 'expensive',
price: 15,
},
cheaper: {
planCode: 'cheaper',
price: 5,
},
alsoCheap: {
plancode: 'also-cheap',
price: 5,
},
bad: {},
}
describe('SubscriptionHelper', function () {
beforeEach(function () {
this.SubscriptionHelper = SandboxedModule.require(modulePath)
})
describe('shouldPlanChangeAtTermEnd', function () {
it('should return true if the new plan is less expensive', function () {
const changeAtTermEnd = this.SubscriptionHelper.shouldPlanChangeAtTermEnd(
plans.expensive,
plans.cheaper
)
expect(changeAtTermEnd).to.be.true
})
it('should return false if the new plan is more exepensive', function () {
const changeAtTermEnd = this.SubscriptionHelper.shouldPlanChangeAtTermEnd(
plans.cheaper,
plans.expensive
)
expect(changeAtTermEnd).to.be.false
})
it('should return false if the new plan is the same price', function () {
const changeAtTermEnd = this.SubscriptionHelper.shouldPlanChangeAtTermEnd(
plans.cheaper,
plans.alsoCheap
)
expect(changeAtTermEnd).to.be.false
})
})
})
| overleaf/web/test/unit/src/Subscription/SubscriptionHelperTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/Subscription/SubscriptionHelperTests.js",
"repo_id": "overleaf",
"token_count": 514
} | 626 |
/* eslint-disable
node/handle-callback-err,
max-len,
no-return-assign,
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const SandboxedModule = require('sandboxed-module')
const assert = require('assert')
const path = require('path')
const sinon = require('sinon')
const modulePath = path.join(
__dirname,
'../../../../app/src/Features/TokenAccess/TokenAccessHandler'
)
const { expect } = require('chai')
const { ObjectId } = require('mongodb')
describe('TokenAccessHandler', function () {
beforeEach(function () {
this.token = 'abcdefabcdef'
this.projectId = ObjectId()
this.project = {
_id: this.projectId,
publicAccesLevel: 'tokenBased',
owner_ref: ObjectId(),
}
this.userId = ObjectId()
this.req = {}
return (this.TokenAccessHandler = SandboxedModule.require(modulePath, {
requires: {
mongodb: { ObjectId },
'../../models/Project': { Project: (this.Project = {}) },
'@overleaf/settings': (this.settings = {}),
'../V1/V1Api': (this.V1Api = {
request: sinon.stub(),
}),
crypto: (this.Crypto = require('crypto')),
'../Analytics/AnalyticsManager': (this.Analytics = {
recordEvent: sinon.stub(),
}),
},
}))
})
describe('getTokenType', function () {
it('should determine tokens correctly', function () {
const specs = {
abcdefabcdef: 'readOnly',
aaaaaabbbbbb: 'readOnly',
'54325aaaaaa': 'readAndWrite',
'54325aaaaaabbbbbb': 'readAndWrite',
'': null,
abc123def: null,
}
for (var token of Object.keys(specs)) {
expect(this.TokenAccessHandler.getTokenType(token)).to.equal(
specs[token]
)
}
})
})
describe('getProjectByReadOnlyToken', function () {
beforeEach(function () {
this.token = 'abcdefabcdef'
this.Project.findOne = sinon.stub().callsArgWith(2, null, this.project)
})
it('should get the project', function (done) {
this.TokenAccessHandler.getProjectByReadOnlyToken(
this.token,
(err, project) => {
expect(err).to.not.exist
expect(project).to.exist
expect(this.Project.findOne.callCount).to.equal(1)
done()
}
)
})
})
describe('getProjectByReadAndWriteToken', function () {
beforeEach(function () {
sinon.spy(this.Crypto, 'timingSafeEqual')
this.token = '1234abcdefabcdef'
this.project.tokens = {
readAndWrite: this.token,
readAndWritePrefix: '1234',
}
this.Project.findOne = sinon.stub().callsArgWith(2, null, this.project)
})
afterEach(function () {
this.Crypto.timingSafeEqual.restore()
})
it('should get the project and do timing-safe comparison', function (done) {
this.TokenAccessHandler.getProjectByReadAndWriteToken(
this.token,
(err, project) => {
expect(err).to.not.exist
expect(project).to.exist
expect(this.Crypto.timingSafeEqual.callCount).to.equal(1)
expect(
this.Crypto.timingSafeEqual.calledWith(Buffer.from(this.token))
).to.equal(true)
expect(this.Project.findOne.callCount).to.equal(1)
done()
}
)
})
})
describe('addReadOnlyUserToProject', function () {
beforeEach(function () {
return (this.Project.updateOne = sinon.stub().callsArgWith(2, null))
})
it('should call Project.updateOne', function (done) {
return this.TokenAccessHandler.addReadOnlyUserToProject(
this.userId,
this.projectId,
err => {
expect(this.Project.updateOne.callCount).to.equal(1)
expect(
this.Project.updateOne.calledWith({
_id: this.projectId,
})
).to.equal(true)
expect(
this.Project.updateOne.lastCall.args[1].$addToSet
).to.have.keys('tokenAccessReadOnly_refs')
sinon.assert.calledWith(
this.Analytics.recordEvent,
this.userId,
'project-joined',
{ mode: 'read-only' }
)
return done()
}
)
})
it('should not produce an error', function (done) {
return this.TokenAccessHandler.addReadOnlyUserToProject(
this.userId,
this.projectId,
err => {
expect(err).to.not.exist
return done()
}
)
})
describe('when Project.updateOne produces an error', function () {
beforeEach(function () {
return (this.Project.updateOne = sinon
.stub()
.callsArgWith(2, new Error('woops')))
})
it('should produce an error', function (done) {
return this.TokenAccessHandler.addReadOnlyUserToProject(
this.userId,
this.projectId,
err => {
expect(err).to.exist
return done()
}
)
})
})
})
describe('addReadAndWriteUserToProject', function () {
beforeEach(function () {
return (this.Project.updateOne = sinon.stub().callsArgWith(2, null))
})
it('should call Project.updateOne', function (done) {
return this.TokenAccessHandler.addReadAndWriteUserToProject(
this.userId,
this.projectId,
err => {
expect(this.Project.updateOne.callCount).to.equal(1)
expect(
this.Project.updateOne.calledWith({
_id: this.projectId,
})
).to.equal(true)
expect(
this.Project.updateOne.lastCall.args[1].$addToSet
).to.have.keys('tokenAccessReadAndWrite_refs')
sinon.assert.calledWith(
this.Analytics.recordEvent,
this.userId,
'project-joined',
{ mode: 'read-write' }
)
return done()
}
)
})
it('should not produce an error', function (done) {
return this.TokenAccessHandler.addReadAndWriteUserToProject(
this.userId,
this.projectId,
err => {
expect(err).to.not.exist
return done()
}
)
})
describe('when Project.updateOne produces an error', function () {
beforeEach(function () {
return (this.Project.updateOne = sinon
.stub()
.callsArgWith(2, new Error('woops')))
})
it('should produce an error', function (done) {
return this.TokenAccessHandler.addReadAndWriteUserToProject(
this.userId,
this.projectId,
err => {
expect(err).to.exist
return done()
}
)
})
})
})
describe('grantSessionTokenAccess', function () {
beforeEach(function () {
return (this.req = { session: {}, headers: {} })
})
it('should add the token to the session', function (done) {
this.TokenAccessHandler.grantSessionTokenAccess(
this.req,
this.projectId,
this.token
)
expect(
this.req.session.anonTokenAccess[this.projectId.toString()]
).to.equal(this.token)
return done()
})
})
describe('validateTokenForAnonymousAccess', function () {
describe('when a read-only project is found', function () {
beforeEach(function () {
this.TokenAccessHandler.getTokenType = sinon.stub().returns('readOnly')
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(2, null, this.project)
})
it('should try to find projects with both kinds of token', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, allowed) => {
expect(
this.TokenAccessHandler.getProjectByToken.callCount
).to.equal(1)
return done()
}
)
})
it('should allow read-only access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(false)
expect(ro).to.equal(true)
return done()
}
)
})
})
describe('when a read-and-write project is found', function () {
beforeEach(function () {
this.TokenAccessHandler.getTokenType = sinon
.stub()
.returns('readAndWrite')
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(2, null, this.project)
})
describe('when Anonymous token access is not enabled', function (done) {
beforeEach(function () {
this.TokenAccessHandler.ANONYMOUS_READ_AND_WRITE_ENABLED = false
})
it('should try to find projects with both kinds of token', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(
this.TokenAccessHandler.getProjectByToken.callCount
).to.equal(1)
return done()
}
)
})
it('should not allow read-and-write access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(false)
expect(ro).to.equal(false)
return done()
}
)
})
})
describe('when anonymous token access is enabled', function (done) {
beforeEach(function () {
this.TokenAccessHandler.ANONYMOUS_READ_AND_WRITE_ENABLED = true
})
it('should try to find projects with both kinds of token', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(
this.TokenAccessHandler.getProjectByToken.callCount
).to.equal(1)
return done()
}
)
})
it('should allow read-and-write access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(true)
expect(ro).to.equal(false)
return done()
}
)
})
})
})
describe('when no project is found', function () {
beforeEach(function () {
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(2, null, null, null)
})
it('should try to find projects with both kinds of token', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, allowed) => {
expect(
this.TokenAccessHandler.getProjectByToken.callCount
).to.equal(1)
return done()
}
)
})
it('should not allow any access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(false)
expect(ro).to.equal(false)
return done()
}
)
})
})
describe('when findProject produces an error', function () {
beforeEach(function () {
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(2, new Error('woops'))
})
it('should try to find projects with both kinds of token', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, allowed) => {
expect(
this.TokenAccessHandler.getProjectByToken.callCount
).to.equal(1)
return done()
}
)
})
it('should produce an error and not allow access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.exist
expect(err).to.be.instanceof(Error)
expect(rw).to.equal(undefined)
expect(ro).to.equal(undefined)
return done()
}
)
})
})
describe('when project is not set to token-based access', function () {
beforeEach(function () {
return (this.project.publicAccesLevel = 'private')
})
describe('for read-and-write project', function () {
beforeEach(function () {
this.TokenAccessHandler.getTokenType = sinon
.stub()
.returns('readAndWrite')
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(2, null, this.project)
})
it('should not allow any access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(false)
expect(ro).to.equal(false)
return done()
}
)
})
})
describe('for read-only project', function () {
beforeEach(function () {
this.TokenAccessHandler.getTokenType = sinon
.stub()
.returns('readOnly')
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(2, null, this.project)
})
it('should not allow any access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
this.token,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(false)
expect(ro).to.equal(false)
return done()
}
)
})
})
describe('with nothing', function () {
beforeEach(function () {
this.TokenAccessHandler.getProjectByToken = sinon
.stub()
.callsArgWith(1, null, null, null)
})
it('should not allow any access', function (done) {
return this.TokenAccessHandler.validateTokenForAnonymousAccess(
this.projectId,
null,
(err, rw, ro) => {
expect(err).to.not.exist
expect(rw).to.equal(false)
expect(ro).to.equal(false)
return done()
}
)
})
})
})
})
describe('protectTokens', function () {
beforeEach(function () {
return (this.project = {
tokens: {
readAndWrite: 'rw',
readOnly: 'ro',
readAndWritePrefix: 'pre',
},
})
})
it('should hide write token from read-only user', function () {
this.TokenAccessHandler.protectTokens(this.project, 'readOnly')
expect(this.project.tokens.readAndWrite).to.equal('')
expect(this.project.tokens.readAndWritePrefix).to.equal('')
return expect(this.project.tokens.readOnly).to.equal('ro')
})
it('should hide read token from read-write user', function () {
this.TokenAccessHandler.protectTokens(this.project, 'readAndWrite')
expect(this.project.tokens.readAndWrite).to.equal('rw')
return expect(this.project.tokens.readOnly).to.equal('')
})
it('should leave tokens in place for owner', function () {
this.TokenAccessHandler.protectTokens(this.project, 'owner')
expect(this.project.tokens.readAndWrite).to.equal('rw')
return expect(this.project.tokens.readOnly).to.equal('ro')
})
})
describe('getDocPublishedInfo', function () {
beforeEach(function () {
return (this.callback = sinon.stub())
})
describe('when v1 api not set', function () {
beforeEach(function () {
this.settings.apis = { v1: undefined }
return this.TokenAccessHandler.getV1DocPublishedInfo(
this.token,
this.callback
)
})
it('should not check access and return default info', function () {
expect(this.V1Api.request.called).to.equal(false)
return expect(
this.callback.calledWith(null, {
allow: true,
})
).to.equal(true)
})
})
describe('when v1 api is set', function () {
beforeEach(function () {
return (this.settings.apis = { v1: { url: 'v1Url' } })
})
describe('on V1Api.request success', function () {
beforeEach(function () {
this.V1Api.request = sinon
.stub()
.callsArgWith(1, null, null, 'mock-data')
return this.TokenAccessHandler.getV1DocPublishedInfo(
this.token,
this.callback
)
})
it('should return response body', function () {
expect(
this.V1Api.request.calledWith({
url: `/api/v1/sharelatex/docs/${this.token}/is_published`,
})
).to.equal(true)
return expect(this.callback.calledWith(null, 'mock-data')).to.equal(
true
)
})
})
describe('on V1Api.request error', function () {
beforeEach(function () {
this.V1Api.request = sinon.stub().callsArgWith(1, 'error')
return this.TokenAccessHandler.getV1DocPublishedInfo(
this.token,
this.callback
)
})
it('should callback with error', function () {
return expect(this.callback.calledWith('error')).to.equal(true)
})
})
})
})
describe('getV1DocInfo', function () {
beforeEach(function () {
return (this.callback = sinon.stub())
})
describe('when v1 api not set', function () {
beforeEach(function () {
return this.TokenAccessHandler.getV1DocInfo(
this.token,
this.v2UserId,
this.callback
)
})
it('should not check access and return default info', function () {
expect(this.V1Api.request.called).to.equal(false)
return expect(
this.callback.calledWith(null, {
exists: true,
exported: false,
})
).to.equal(true)
})
})
describe('when v1 api is set', function () {
beforeEach(function () {
return (this.settings.apis = { v1: 'v1' })
})
describe('on V1Api.request success', function () {
beforeEach(function () {
this.V1Api.request = sinon
.stub()
.callsArgWith(1, null, null, 'mock-data')
return this.TokenAccessHandler.getV1DocInfo(
this.token,
this.v2UserId,
this.callback
)
})
it('should return response body', function () {
expect(
this.V1Api.request.calledWith({
url: `/api/v1/sharelatex/docs/${this.token}/info`,
})
).to.equal(true)
return expect(this.callback.calledWith(null, 'mock-data')).to.equal(
true
)
})
})
describe('on V1Api.request error', function () {
beforeEach(function () {
this.V1Api.request = sinon.stub().callsArgWith(1, 'error')
return this.TokenAccessHandler.getV1DocInfo(
this.token,
this.v2UserId,
this.callback
)
})
it('should callback with error', function () {
return expect(this.callback.calledWith('error')).to.equal(true)
})
})
})
})
})
| overleaf/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js",
"repo_id": "overleaf",
"token_count": 9699
} | 627 |
/* eslint-disable
max-len,
no-return-assign,
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const sinon = require('sinon')
const { assert, expect } = require('chai')
const modulePath = '../../../../app/src/Features/User/UserInfoController.js'
const SandboxedModule = require('sandboxed-module')
const events = require('events')
const MockResponse = require('../helpers/MockResponse')
const MockRequest = require('../helpers/MockRequest')
const { ObjectId } = require('mongodb')
describe('UserInfoController', function () {
beforeEach(function () {
this.UserDeleter = { deleteUser: sinon.stub().callsArgWith(1) }
this.UserUpdater = { updatePersonalInfo: sinon.stub() }
this.UserGetter = {}
this.UserInfoController = SandboxedModule.require(modulePath, {
requires: {
mongodb: { ObjectId },
'./UserGetter': this.UserGetter,
'./UserUpdater': this.UserUpdater,
'./UserDeleter': this.UserDeleter,
'../Authentication/SessionManager': (this.SessionManager = {
getLoggedInUserId: sinon.stub(),
}),
},
})
this.req = new MockRequest()
this.res = new MockResponse()
return (this.next = sinon.stub())
})
describe('getLoggedInUsersPersonalInfo', function () {
beforeEach(function () {
this.user = { _id: ObjectId() }
this.req.user = this.user
this.req.session.user = this.user
this.UserInfoController.sendFormattedPersonalInfo = sinon.stub()
this.UserGetter.getUser = sinon.stub().callsArgWith(2, null, this.user)
this.SessionManager.getLoggedInUserId = sinon
.stub()
.returns(this.user._id)
return this.UserInfoController.getLoggedInUsersPersonalInfo(
this.req,
this.res,
this.next
)
})
it('should call sendFormattedPersonalInfo', function () {
return this.UserInfoController.sendFormattedPersonalInfo
.calledWith(this.user, this.res, this.next)
.should.equal(true)
})
})
describe('getPersonalInfo', function () {
describe('when the user exists with sharelatex id', function () {
beforeEach(function () {
this.user_id = ObjectId().toString()
this.user = { _id: ObjectId(this.user_id) }
this.req.params = { user_id: this.user_id }
this.UserGetter.getUser = sinon.stub().callsArgWith(2, null, this.user)
this.UserInfoController.sendFormattedPersonalInfo = sinon.stub()
return this.UserInfoController.getPersonalInfo(
this.req,
this.res,
this.next
)
})
it('should look up the user in the database', function () {
return this.UserGetter.getUser
.calledWith(
{ _id: ObjectId(this.user_id) },
{ _id: true, first_name: true, last_name: true, email: true }
)
.should.equal(true)
})
it('should send the formatted details back to the client', function () {
return this.UserInfoController.sendFormattedPersonalInfo
.calledWith(this.user, this.res, this.next)
.should.equal(true)
})
})
describe('when the user exists with overleaf id', function () {
beforeEach(function () {
this.user_id = 12345
this.user = {
_id: ObjectId(),
overleaf: {
id: this.user_id,
},
}
this.req.params = { user_id: this.user_id.toString() }
this.UserGetter.getUser = sinon.stub().callsArgWith(2, null, this.user)
this.UserInfoController.sendFormattedPersonalInfo = sinon.stub()
return this.UserInfoController.getPersonalInfo(
this.req,
this.res,
this.next
)
})
it('should look up the user in the database', function () {
return this.UserGetter.getUser
.calledWith(
{ 'overleaf.id': this.user_id },
{ _id: true, first_name: true, last_name: true, email: true }
)
.should.equal(true)
})
it('should send the formatted details back to the client', function () {
return this.UserInfoController.sendFormattedPersonalInfo
.calledWith(this.user, this.res, this.next)
.should.equal(true)
})
})
describe('when the user does not exist', function () {
beforeEach(function () {
this.user_id = ObjectId().toString()
this.req.params = { user_id: this.user_id }
this.UserGetter.getUser = sinon.stub().callsArgWith(2, null, null)
return this.UserInfoController.getPersonalInfo(
this.req,
this.res,
this.next
)
})
it('should return 404 to the client', function () {
return this.res.statusCode.should.equal(404)
})
})
describe('when the user id is invalid', function () {
beforeEach(function () {
this.user_id = 'invalid'
this.req.params = { user_id: this.user_id }
this.UserGetter.getUser = sinon.stub().callsArgWith(2, null, null)
return this.UserInfoController.getPersonalInfo(
this.req,
this.res,
this.next
)
})
it('should return 400 to the client', function () {
return this.res.statusCode.should.equal(400)
})
})
})
describe('sendFormattedPersonalInfo', function () {
beforeEach(function () {
this.user = {
_id: ObjectId(),
first_name: 'Douglas',
last_name: 'Adams',
email: 'doug@sharelatex.com',
}
this.formattedInfo = {
id: this.user._id.toString(),
first_name: this.user.first_name,
last_name: this.user.last_name,
email: this.user.email,
}
this.UserInfoController.formatPersonalInfo = sinon
.stub()
.returns(this.formattedInfo)
return this.UserInfoController.sendFormattedPersonalInfo(
this.user,
this.res
)
})
it('should format the user details for the response', function () {
return this.UserInfoController.formatPersonalInfo
.calledWith(this.user)
.should.equal(true)
})
it('should send the formatted details back to the client', function () {
return this.res.body.should.equal(JSON.stringify(this.formattedInfo))
})
})
describe('formatPersonalInfo', function () {
it('should return the correctly formatted data', function () {
this.user = {
_id: ObjectId(),
first_name: 'Douglas',
last_name: 'Adams',
email: 'doug@sharelatex.com',
password: 'should-not-get-included',
signUpDate: new Date(),
role: 'student',
institution: 'sheffield',
}
return expect(
this.UserInfoController.formatPersonalInfo(this.user)
).to.deep.equal({
id: this.user._id.toString(),
first_name: this.user.first_name,
last_name: this.user.last_name,
email: this.user.email,
signUpDate: this.user.signUpDate,
role: this.user.role,
institution: this.user.institution,
})
})
})
})
| overleaf/web/test/unit/src/User/UserInfoControllerTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/User/UserInfoControllerTests.js",
"repo_id": "overleaf",
"token_count": 3164
} | 628 |
const mockModel = require('../MockModel')
module.exports = mockModel('DeletedProject', {
'./Project': require('./Project'),
})
| overleaf/web/test/unit/src/helpers/models/DeletedProject.js/0 | {
"file_path": "overleaf/web/test/unit/src/helpers/models/DeletedProject.js",
"repo_id": "overleaf",
"token_count": 41
} | 629 |
const { expect } = require('chai')
const SandboxedModule = require('sandboxed-module')
const MODULE_PATH = '../../../../app/src/infrastructure/Translations.js'
describe('Translations', function () {
let req, res, translations
function runMiddlewares(cb) {
translations.i18nMiddleware(req, res, () => {
translations.setLangBasedOnDomainMiddleware(req, res, cb)
})
}
beforeEach(function () {
translations = SandboxedModule.require(MODULE_PATH, {
requires: {
'@overleaf/settings': {
i18n: {
escapeHTMLInVars: false,
subdomainLang: {
www: { lngCode: 'en', url: 'https://www.sharelatex.com' },
fr: { lngCode: 'fr', url: 'https://fr.sharelatex.com' },
da: { lngCode: 'da', url: 'https://da.sharelatex.com' },
},
},
},
},
})
req = {
url: '/',
headers: {
'accept-language': '',
},
}
res = {
locals: {},
getHeader: () => {},
setHeader: () => {},
}
})
describe('translate', function () {
beforeEach(function (done) {
runMiddlewares(done)
})
it('works', function () {
expect(req.i18n.t('give_feedback')).to.equal('Give feedback')
})
it('has translate alias', function () {
expect(req.i18n.translate('give_feedback')).to.equal('Give feedback')
})
})
describe('interpolation', function () {
beforeEach(function (done) {
runMiddlewares(done)
})
it('works', function () {
expect(
req.i18n.t('please_confirm_email', {
emailAddress: 'foo@example.com',
})
).to.equal(
'Please confirm your email foo@example.com by clicking on the link in the confirmation email '
)
})
it('handles dashes after interpolation', function () {
// This translation string has a problematic interpolation followed by a
// dash: `__len__-day`
expect(
req.i18n.t('faq_how_does_free_trial_works_answer', {
appName: 'Overleaf',
len: '5',
})
).to.equal(
'You get full access to your chosen Overleaf plan during your 5-day free trial. There is no obligation to continue beyond the trial. Your card will be charged at the end of your 5 day trial unless you cancel before then. You can cancel via your subscription settings.'
)
})
it('disables escaping', function () {
expect(
req.i18n.t('admin_user_created_message', {
link: 'http://google.com',
})
).to.equal(
'Created admin user, <a href="http://google.com">Log in here</a> to continue'
)
})
})
describe('setLangBasedOnDomainMiddleware', function () {
it('should set the lang to french if the domain is fr', function (done) {
req.headers.host = 'fr.sharelatex.com'
runMiddlewares(() => {
expect(req.lng).to.equal('fr')
done()
})
})
describe('suggestedLanguageSubdomainConfig', function () {
it('should set suggestedLanguageSubdomainConfig if the detected lang is different to subdomain lang', function (done) {
req.headers['accept-language'] = 'da, en-gb;q=0.8, en;q=0.7'
req.headers.host = 'fr.sharelatex.com'
runMiddlewares(() => {
expect(res.locals.suggestedLanguageSubdomainConfig).to.exist
expect(res.locals.suggestedLanguageSubdomainConfig.lngCode).to.equal(
'da'
)
done()
})
})
it('should not set suggestedLanguageSubdomainConfig if the detected lang is the same as subdomain lang', function (done) {
req.headers['accept-language'] = 'da, en-gb;q=0.8, en;q=0.7'
req.headers.host = 'da.sharelatex.com'
runMiddlewares(() => {
expect(res.locals.suggestedLanguageSubdomainConfig).to.not.exist
done()
})
})
})
})
})
| overleaf/web/test/unit/src/infrastructure/TranslationsTests.js/0 | {
"file_path": "overleaf/web/test/unit/src/infrastructure/TranslationsTests.js",
"repo_id": "overleaf",
"token_count": 1681
} | 630 |
Change: Make settings available in web
We upgraded to a new owncloud-sdk version which provides loading settings from the
settings service, if available. The settings values are available throughout web
and all extensions.
https://github.com/owncloud/web/pull/3484
| owncloud/web/changelog/0.10.0_2020-05-26/3484-1/0 | {
"file_path": "owncloud/web/changelog/0.10.0_2020-05-26/3484-1",
"repo_id": "owncloud",
"token_count": 63
} | 631 |
Bugfix: Set empty object when resetting current sidebar tab
We've changed the argument from `null` to an empty object when resetting the current tab of the sidebar.
https://github.com/owncloud/web/issues/3676
https://github.com/owncloud/web/pull/3678 | owncloud/web/changelog/0.11.0_2020-06-26/set-empty-object-when-resetting-current-tab/0 | {
"file_path": "owncloud/web/changelog/0.11.0_2020-06-26/set-empty-object-when-resetting-current-tab",
"repo_id": "owncloud",
"token_count": 70
} | 632 |
Change: No file drop if upload is not allowed or no space is left
https://github.com/owncloud/web/pull/3677
| owncloud/web/changelog/0.12.0_2020-07-10/no-dragndrop-if-upload-not-allowed/0 | {
"file_path": "owncloud/web/changelog/0.12.0_2020-07-10/no-dragndrop-if-upload-not-allowed",
"repo_id": "owncloud",
"token_count": 33
} | 633 |
Enhancement: Add info about number of selected items and their size
We've added information about the number of selected items and their size above the files list next to batch actions.
https://github.com/owncloud/product/issues/122
https://github.com/owncloud/web/pull/3850 | owncloud/web/changelog/0.16.0_2020-08-24/multi-select-info/0 | {
"file_path": "owncloud/web/changelog/0.16.0_2020-08-24/multi-select-info",
"repo_id": "owncloud",
"token_count": 70
} | 634 |
Change: Customizable menu association
We now allow the redirect navItems and links into the user menu. This can be done by simply assigning the `"menu": "user"` to the respective navItem. It works for both extensions and external links (`applications` key in config.json).
https://github.com/owncloud/web/pull/4133
| owncloud/web/changelog/0.19.0_2020-10-06/user-menu.md/0 | {
"file_path": "owncloud/web/changelog/0.19.0_2020-10-06/user-menu.md",
"repo_id": "owncloud",
"token_count": 82
} | 635 |
Bugfix: Make available file actions (more) aware of the page context
The list of available file actions sometimes contained actions which should not be possible and sometimes was missing actions that should be possible. Most important examples are that copy/move should not be available on `shared with me` and `shared with others` pages (but they were) and that the set of file actions from the `All files` page should also be available for the favorites page (but were not).
https://github.com/owncloud/web/pull/4255
| owncloud/web/changelog/0.25.0_2020-11-16/context-sensitive-actions/0 | {
"file_path": "owncloud/web/changelog/0.25.0_2020-11-16/context-sensitive-actions",
"repo_id": "owncloud",
"token_count": 116
} | 636 |
Change: Use labels to display share info
We've changed the way of displaying share information for public links and people. Every information is now displayed in its own label.
https://github.com/owncloud/web/pull/4410
| owncloud/web/changelog/0.29.0_2020-12-07/share-info-labels/0 | {
"file_path": "owncloud/web/changelog/0.29.0_2020-12-07/share-info-labels",
"repo_id": "owncloud",
"token_count": 53
} | 637 |
Change: Display only items for current extension in sidebar menu
We've filtered out nav items in the sidebar menu. Now only items for current extension will be displayed.
In case the extension has only one nav item, the sidebar menu is hidden and instead of menu button is displayed the name of extension.
https://github.com/owncloud/web/issues/2746
https://github.com/owncloud/web/pull/3013
| owncloud/web/changelog/0.4.0_2020-02-14/2746/0 | {
"file_path": "owncloud/web/changelog/0.4.0_2020-02-14/2746",
"repo_id": "owncloud",
"token_count": 96
} | 638 |
Enhancement: Current user entry in collaborators list in sidebar
We've added a new entry into the collaborators list in sidebar which contains current user.
https://github.com/owncloud/web/issues/3808
https://github.com/owncloud/web/pull/3060
| owncloud/web/changelog/0.5.0_2020-03-02/3808/0 | {
"file_path": "owncloud/web/changelog/0.5.0_2020-03-02/3808",
"repo_id": "owncloud",
"token_count": 65
} | 639 |
Bugfix: Files list status indicators are now appearing without any delay
We've stopped loading file list status indicators asynchronously to prevent them from appearing delayed. They
appear now at the same time as the file list.
https://github.com/owncloud/web/issues/2973
https://github.com/owncloud/web/pull/3213
| owncloud/web/changelog/0.7.0_2020-03-30/3213/0 | {
"file_path": "owncloud/web/changelog/0.7.0_2020-03-30/3213",
"repo_id": "owncloud",
"token_count": 82
} | 640 |
Change: update owncloud-sdk
Updated owncloud-sdk to v1.0.0-604
https://github.com/owncloud/web/pull/3369 | owncloud/web/changelog/0.9.0_2020-04-27/update_owncloud_sdk/0 | {
"file_path": "owncloud/web/changelog/0.9.0_2020-04-27/update_owncloud_sdk",
"repo_id": "owncloud",
"token_count": 42
} | 641 |
Change: Rename confirmation of copy action
We've changed the label of the confirmation button in copy view. Instead of "Copy here", we used "Paste here".
https://github.com/owncloud/web/pull/4590
| owncloud/web/changelog/1.0.1_2021-01-08/copy-action-label/0 | {
"file_path": "owncloud/web/changelog/1.0.1_2021-01-08/copy-action-label",
"repo_id": "owncloud",
"token_count": 54
} | 642 |
Enhancement: Use pre-signed url download for password protected shares
Replaced the blob download with a normal download using a pre-signed url provided by the backend.
https://github.com/owncloud/core/pull/38376
https://github.com/owncloud/web/pull/4689
| owncloud/web/changelog/2.1.0_2021-03-24/enhancement-public-link-download/0 | {
"file_path": "owncloud/web/changelog/2.1.0_2021-03-24/enhancement-public-link-download",
"repo_id": "owncloud",
"token_count": 71
} | 643 |
Bugfix: Improve web container
The wrapping `index.html.ejs` had some minor problems with HTML validators which are now fixed.
https://github.com/owncloud/web/pull/4942
| owncloud/web/changelog/3.1.0_2021-05-12/bugfix-improve-web-container/0 | {
"file_path": "owncloud/web/changelog/3.1.0_2021-05-12/bugfix-improve-web-container",
"repo_id": "owncloud",
"token_count": 49
} | 644 |
Enhancement: Continuously deployed demo instance with latest Web
Whenever a commit or merge to master happens, a demo instance with the latest Web build will be deployed.
https://github.com/owncloud/web/pull/5145
| owncloud/web/changelog/3.2.0_2021-05-31/enhancement-continuously-deployed-demo-instance/0 | {
"file_path": "owncloud/web/changelog/3.2.0_2021-05-31/enhancement-continuously-deployed-demo-instance",
"repo_id": "owncloud",
"token_count": 53
} | 645 |
Bugfix: Translated user menu items
Some of the user menu items were not correctly translated, which is now fixed.
https://github.com/owncloud/web/pull/5042
| owncloud/web/changelog/3.3.0_2021-06-23/bugfix-translated-user-menu-items/0 | {
"file_path": "owncloud/web/changelog/3.3.0_2021-06-23/bugfix-translated-user-menu-items",
"repo_id": "owncloud",
"token_count": 44
} | 646 |
Enhancement: Focus breadcrumb on route change
We now focus the current breadcrumb item when navigating to another page
and announce the amount of files and folders in the folder the user
has navigated to.
https://github.com/owncloud/web/pull/5166
| owncloud/web/changelog/3.3.0_2021-06-23/enhancement-focus-breadcrumb-on-route-change/0 | {
"file_path": "owncloud/web/changelog/3.3.0_2021-06-23/enhancement-focus-breadcrumb-on-route-change",
"repo_id": "owncloud",
"token_count": 67
} | 647 |
Enhancement: TypeScript Support
We have added support for TypeScript and started to refactor parts of the codebase.
This will help us provide clearer interfaces and catch bugs earlier.
https://github.com/owncloud/web/pull/5194
| owncloud/web/changelog/3.3.0_2021-06-23/enhancement-typescript-support/0 | {
"file_path": "owncloud/web/changelog/3.3.0_2021-06-23/enhancement-typescript-support",
"repo_id": "owncloud",
"token_count": 58
} | 648 |
Bugfix: Left sidebar visibility in public links
We fixed that the left sidebar was showing the navigation items of an authenticated context when visiting a public link as authenticated user.
https://github.com/owncloud/web/pull/5602
| owncloud/web/changelog/4.0.0_2021-08-04/bugfix-left-sidebar-public-link/0 | {
"file_path": "owncloud/web/changelog/4.0.0_2021-08-04/bugfix-left-sidebar-public-link",
"repo_id": "owncloud",
"token_count": 53
} | 649 |
Bugfix: Handle loading and parsing errors when loading themes
Adds graceful error handling of json parse errors when loading custom themes.
https://github.com/owncloud/web/pull/5669
| owncloud/web/changelog/4.1.0_2021-08-20/bugfix-handle-errors-when-loading-themes/0 | {
"file_path": "owncloud/web/changelog/4.1.0_2021-08-20/bugfix-handle-errors-when-loading-themes",
"repo_id": "owncloud",
"token_count": 44
} | 650 |
Enhancement: Switch filesize calculation base
We've switched from base-2 to base-10 when calculating the displayed file-size
to align it better with user expectations.
https://github.com/owncloud/web/pull/5739
| owncloud/web/changelog/4.2.0_2021-09-14/enhancement-switch-filesize-calculation-base/0 | {
"file_path": "owncloud/web/changelog/4.2.0_2021-09-14/enhancement-switch-filesize-calculation-base",
"repo_id": "owncloud",
"token_count": 57
} | 651 |
Enhancement: Accessible, themeable media viewer
We have updated the media viewer app to respect theme colors and
fulfill accessibility requirements (e.g. keyboard navigation, semantic HTML, font size).
https://github.com/owncloud/web/pull/5900
| owncloud/web/changelog/4.4.0_2021-10-26/enhancement-accessible-themeable-mediaviewer/0 | {
"file_path": "owncloud/web/changelog/4.4.0_2021-10-26/enhancement-accessible-themeable-mediaviewer",
"repo_id": "owncloud",
"token_count": 63
} | 652 |
Bugfix: Pagination
We fixed the pagination as it was slicing the items wrong on pages after the first one.
https://github.com/owncloud/web/pull/6056
| owncloud/web/changelog/4.6.0_2021-12-07/bugfix-pagination/0 | {
"file_path": "owncloud/web/changelog/4.6.0_2021-12-07/bugfix-pagination",
"repo_id": "owncloud",
"token_count": 44
} | 653 |
Bugfix: Double escaping in progress bar
We fixed file names with special chars not being properly displayed in the upload progressbar.
https://github.com/owncloud/web/issues/4214
https://github.com/owncloud/web/pull/6131
| owncloud/web/changelog/4.7.0_2021-12-16/bugfix-progressbar-escaping/0 | {
"file_path": "owncloud/web/changelog/4.7.0_2021-12-16/bugfix-progressbar-escaping",
"repo_id": "owncloud",
"token_count": 61
} | 654 |
Bugfix: Failed move by drag'n'drop doesn't show the resource name in the error
We fixed the error message when moving an item via drag-and-drop failed, now it shows the correct name of the item.
https://github.com/owncloud/web/issues/6412
| owncloud/web/changelog/5.0.0_2022-02-14/bugfix-error-message-move/0 | {
"file_path": "owncloud/web/changelog/5.0.0_2022-02-14/bugfix-error-message-move",
"repo_id": "owncloud",
"token_count": 67
} | 655 |
Enhancement: Context Route Params
We now add params of the source context route to the query of app routes and
convert them back to params when routing back to the origin - this is necessary
to properly navigate back from opening files in extensions or in search results,
throughout personal, public or, in the future, spaces views.
https://github.com/owncloud/web/pull/6331
https://github.com/owncloud/web/issues/6390
| owncloud/web/changelog/5.0.0_2022-02-14/enhancement-context-route-params/0 | {
"file_path": "owncloud/web/changelog/5.0.0_2022-02-14/enhancement-context-route-params",
"repo_id": "owncloud",
"token_count": 110
} | 656 |
Enhancement: Update ODS to v12.1.0
We updated the ownCloud Design System to version 12.1.0. Please refer to the full changelog in the ODS release (linked) for more details. Summary:
- Change - Drop Internet Explorer support: https://github.com/owncloud/owncloud-design-system/pull/1909
- Change - Do not sort in OcTable: https://github.com/owncloud/owncloud-design-system/pull/1825
- Change - Pass folderLink to OcResource component: https://github.com/owncloud/owncloud-design-system/pull/1913
- Change - Remove OcAppSideBar component: https://github.com/owncloud/owncloud-design-system/pull/1810
- Change - Remove OcAppBar component: https://github.com/owncloud/owncloud-design-system/pull/1810
- Change - Remove implicit ODS registration: https://github.com/owncloud/owncloud-design-system/pull/1848
- Change - Remove oc-table-files from ods: https://github.com/owncloud/owncloud-design-system/pull/1817
- Change - Remove OcGrid options: https://github.com/owncloud/owncloud-design-system/pull/1658
- Change - Move OcSidebarNav and OcSidebarNavItem to web: https://github.com/owncloud/web/issues/6036
- Change - Remove UiKit: https://github.com/owncloud/owncloud-design-system/pull/1658
- Change - Remove unused props for unstyled components: https://github.com/owncloud/owncloud-design-system/pull/1795
- Change - Use remixicons for redesign: https://github.com/owncloud/owncloud-design-system/pull/1826
- Enhancement - Make Vue-Composition-API available: https://github.com/owncloud/owncloud-design-system/pull/1848
- Enhancement - Export mappings of types, icons and colors of resources: https://github.com/owncloud/owncloud-design-system/pull/1920
- Enhancement - Fix OcAvatar line-height: https://github.com/owncloud/owncloud-design-system/pull/1810
- Enhancement - Add option to render table cells lazy: https://github.com/owncloud/owncloud-design-system/pull/1848
- Enhancement - Make OcDrop rounded: https://github.com/owncloud/owncloud-design-system/pull/1881
- Enhancement - Change background color of OcDrop: https://github.com/owncloud/owncloud-design-system/pull/1919
- Enhancement - Improve OcList: https://github.com/owncloud/owncloud-design-system/pull/1881
- Enhancement - Show path / parent folder to distinguish files: https://github.com/owncloud/web/issues/5953
- Enhancement - Redesign Filetype icons: https://github.com/owncloud/web/issues/6278
- Enhancement - Adjust OcSearchBar to new design: https://github.com/owncloud/owncloud-design-system/pull/1810/
- Enhancement - Sizes: https://github.com/owncloud/owncloud-design-system/pull/1858
- Enhancement - Add svg icon for spaces: https://github.com/owncloud/owncloud-design-system/pull/1846
- Enhancement - OcTable header alignment: https://github.com/owncloud/owncloud-design-system/pull/1922
- Enhancement - Use Roboto font: https://github.com/owncloud/owncloud-design-system/pull/1876
- Enhancement - Redesign OcModal: https://github.com/owncloud/owncloud-design-system/pull/1953
- Bugfix - Missing OcDrop shadow: https://github.com/owncloud/owncloud-design-system/pull/1926
- Bugfix - OcNotification positioning: https://github.com/owncloud/owncloud-design-system/pull/1658
- Bugfix - Rename GhostElement: https://github.com/owncloud/owncloud-design-system/pull/1845
- Bugfix - OcTooltip isn't reactive: https://github.com/owncloud/owncloud-design-system/pull/1863
- Bugfix - Background-primary-gradient border: https://github.com/owncloud/web/issues/6383
https://github.com/owncloud/web/pull/6086
https://github.com/owncloud/web/pull/6142
https://github.com/owncloud/web/pull/6213
https://github.com/owncloud/web/pull/6228
https://github.com/owncloud/web/pull/6240
https://github.com/owncloud/web/pull/6295
https://github.com/owncloud/web/pull/6360
https://github.com/owncloud/web/pull/6368
https://github.com/owncloud/web/pull/6418
https://github.com/owncloud/owncloud-design-system/releases/tag/v12.0.0
https://github.com/owncloud/owncloud-design-system/releases/tag/v12.1.0
| owncloud/web/changelog/5.0.0_2022-02-14/enhancement-update-ods/0 | {
"file_path": "owncloud/web/changelog/5.0.0_2022-02-14/enhancement-update-ods",
"repo_id": "owncloud",
"token_count": 1249
} | 657 |
Enhancement: Redesign FilesTable
We've redesigned the QuickActions visually
and updated theming to fit the redesign
https://github.com/owncloud/web/issues/6207
https://github.com/owncloud/web/pull/6450
| owncloud/web/changelog/5.2.0_2022-03-03/enhancement-redesign-filestable/0 | {
"file_path": "owncloud/web/changelog/5.2.0_2022-03-03/enhancement-redesign-filestable",
"repo_id": "owncloud",
"token_count": 62
} | 658 |
Bugfix: Natural sort order
We've fixed the sort order to respect natural sorting again. Also used the chance to make use of `Intl.Collator` instead of `localeCompare` which is considered to be a performance improvement.
https://github.com/owncloud/web/issues/6532
https://github.com/owncloud/web/pull/6632
| owncloud/web/changelog/5.3.0_2022-03-23/bugfix-sort-order/0 | {
"file_path": "owncloud/web/changelog/5.3.0_2022-03-23/bugfix-sort-order",
"repo_id": "owncloud",
"token_count": 85
} | 659 |
Enhancement: Resolve private links into folders instead of parent
Private links always resolved into the parent folder of the linked file and visually highlighted the file or folder from the link. We've changed this behaviour to directly navigate into the folder in case the linked resource is a folder and only keep the previous behaviour for when the linked resource is a file.
https://github.com/owncloud/web/issues/5533
https://github.com/owncloud/web/pull/5654
| owncloud/web/changelog/5.3.0_2022-03-23/enhancement-private-link-routing/0 | {
"file_path": "owncloud/web/changelog/5.3.0_2022-03-23/enhancement-private-link-routing",
"repo_id": "owncloud",
"token_count": 106
} | 660 |
Bugfix: AppBar ViewOptions alignment
We have fixed a visual glitch that rendered the ViewOptions in the AppBar on the left side instead of right-aligned if no Breadcrumbs or SharesNavigation is present.
https://github.com/owncloud/web/pull/6662
https://github.com/owncloud/web/issues/6685
| owncloud/web/changelog/5.4.0_2022-04-11/bugfix-appbar-viewoptions-alignment/0 | {
"file_path": "owncloud/web/changelog/5.4.0_2022-04-11/bugfix-appbar-viewoptions-alignment",
"repo_id": "owncloud",
"token_count": 80
} | 661 |
Enhancement: Remove public links from SharedWithOthers page
We've removed links from the shared-with-others page as those belong in the `Shared via link` page (and already exist there).
https://github.com/owncloud/web/issues/5976
https://github.com/owncloud/web/pull/6612
| owncloud/web/changelog/5.4.0_2022-04-11/enhancement-remove-links-shared-with-others/0 | {
"file_path": "owncloud/web/changelog/5.4.0_2022-04-11/enhancement-remove-links-shared-with-others",
"repo_id": "owncloud",
"token_count": 79
} | 662 |
Bugfix: Decrease build time and fix faulty oc10 docker dev env
We've fixed a bug where build times increased on every file change in dev mode,
it also fixes the faulty file sync during docker development for oc10.
https://github.com/owncloud/web/pull/6855
| owncloud/web/changelog/5.5.0_2022-06-20/bugfix-build-time/0 | {
"file_path": "owncloud/web/changelog/5.5.0_2022-06-20/bugfix-build-time",
"repo_id": "owncloud",
"token_count": 69
} | 663 |
Bugfix: Respect quota definition of none/unlimited
We have fixed an UI glitch where the UI stopped working if the backend reports a unlimited storage quota.
https://github.com/owncloud/web/pull/6923
https://github.com/owncloud/web/issues/6913
https://github.com/owncloud/web/pull/7044
| owncloud/web/changelog/5.5.0_2022-06-20/bugfix-respect-unlimited-quota/0 | {
"file_path": "owncloud/web/changelog/5.5.0_2022-06-20/bugfix-respect-unlimited-quota",
"repo_id": "owncloud",
"token_count": 83
} | 664 |
Bugfix: Upload meta data serialization
We've fixed a bug where meta properties of uploading resources could not be serialized, resulting in unnecessary network requests.
https://github.com/owncloud/web/pull/6846
https://github.com/owncloud/web/issues/6819
| owncloud/web/changelog/5.5.0_2022-06-20/bugfix-upload-meta-serialization/0 | {
"file_path": "owncloud/web/changelog/5.5.0_2022-06-20/bugfix-upload-meta-serialization",
"repo_id": "owncloud",
"token_count": 67
} | 665 |
Enhancement: Make contexthelpers opt-out
The contextual helpers needed to actively be enabled in the configuration.
We have now enabled them by default and admins can disable them using the configuration.
https://github.com/owncloud/web/pull/6750#issuecomment-1143753289
| owncloud/web/changelog/5.5.0_2022-06-20/enhancement-enable-contexthelpers-default/0 | {
"file_path": "owncloud/web/changelog/5.5.0_2022-06-20/enhancement-enable-contexthelpers-default",
"repo_id": "owncloud",
"token_count": 69
} | 666 |
Enhancement: Refactor upload input components
We've refactored the upload input components for files and folders into one component.
https://github.com/owncloud/web/pull/6859
https://github.com/owncloud/web/issues/6819
| owncloud/web/changelog/5.5.0_2022-06-20/enhancement-refactor-upload-inputs/0 | {
"file_path": "owncloud/web/changelog/5.5.0_2022-06-20/enhancement-refactor-upload-inputs",
"repo_id": "owncloud",
"token_count": 62
} | 667 |
Enhancement: Clickable folder links in upload overlay
Uploaded folders can now be clicked in the upload overlay, which navigates the user to the clicked folder.
https://github.com/owncloud/web/pull/7109
https://github.com/owncloud/web/issues/7102
| owncloud/web/changelog/5.5.0_2022-06-20/enhancement-upload-overlay-folder-links/0 | {
"file_path": "owncloud/web/changelog/5.5.0_2022-06-20/enhancement-upload-overlay-folder-links",
"repo_id": "owncloud",
"token_count": 69
} | 668 |
Bugfix: Prevent error when pasting with empty clipboard
We've fixed a bug where an error was thrown when pasting with empty clipboard
https://github.com/owncloud/web/pull/7214
https://github.com/owncloud/web/issues/7146
| owncloud/web/changelog/5.7.0_2022-09-09/bugfix-error-when-pasting-empty-clipboard/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-error-when-pasting-empty-clipboard",
"repo_id": "owncloud",
"token_count": 63
} | 669 |
Bugfix: Loading state in views
We fixed a small glitch in views of the files app, where the view would show a state like "Resource not found" in the brief moment before the resource loading started. Now the views correctly start in a loading state.
https://github.com/owncloud/web/pull/7325
https://github.com/owncloud/web/pull/7366
| owncloud/web/changelog/5.7.0_2022-09-09/bugfix-loading-state-in-views/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-loading-state-in-views",
"repo_id": "owncloud",
"token_count": 88
} | 670 |
Bugfix: Re-fetch quota
We've fixed a bug where uploading, deleting or restoring resources doesn't always re-fetch the quota and therefore
was falsy displayed.
https://github.com/owncloud/web/pull/7415
https://github.com/owncloud/web/issues/6930
https://github.com/owncloud/web/issues/7389
| owncloud/web/changelog/5.7.0_2022-09-09/bugfix-re-fetch-quota/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-re-fetch-quota",
"repo_id": "owncloud",
"token_count": 89
} | 671 |
Bugfix: Add storage ID when navigating to a shared parent directory
We've added the missing storage ID when navigating to a shared parent directory.
https://github.com/owncloud/web/pull/7396
| owncloud/web/changelog/5.7.0_2022-09-09/bugfix-storage-id-shared-parent-directory/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-storage-id-shared-parent-directory",
"repo_id": "owncloud",
"token_count": 48
} | 672 |
Enhancement: Change file loading mechanism in `preview` app
Make preview loading mechanism from the `files` app available for all apps and use it in `preview` app.
*DEPRECATION*: This deprecates `v-image-source` directive and the `mediaSource` method mixed into all components. It will be removed in 6.0.0.
https://github.com/owncloud/web/pull/7350
https://github.com/owncloud/web/issues/7233
| owncloud/web/changelog/5.7.0_2022-09-09/enhancement-change-loading-in-preview-app/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/enhancement-change-loading-in-preview-app",
"repo_id": "owncloud",
"token_count": 116
} | 673 |
Enhancement: Replace locationpicker with clipboard actions
We've replaced the locationpicker in batchactions and contextmenu with
the new cut/copy/paste clipboard actions.
https://github.com/owncloud/web/pull/7309
https://github.com/owncloud/web/pull/7503
https://github.com/owncloud/web/issues/6892
| owncloud/web/changelog/5.7.0_2022-09-09/enhancement-replace-locationpicker-clipboard/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/enhancement-replace-locationpicker-clipboard",
"repo_id": "owncloud",
"token_count": 88
} | 674 |
Enhancement: User management app edit quota
We've added the possibility to change user's quota in the user management app.
https://github.com/owncloud/web/pull/7182
https://github.com/owncloud/web/pull/7530
https://github.com/owncloud/web/pull/7538
https://github.com/owncloud/web/issues/7059
| owncloud/web/changelog/5.7.0_2022-09-09/enhancement-user-management-edit-quota/0 | {
"file_path": "owncloud/web/changelog/5.7.0_2022-09-09/enhancement-user-management-edit-quota",
"repo_id": "owncloud",
"token_count": 93
} | 675 |
Bugfix: Hide search bar in public link context
The search bar in a public link context has been hidden because it requires authentication.
https://github.com/owncloud/web/issues/7603
https://github.com/owncloud/web/pull/7849
| owncloud/web/changelog/6.0.0_2022-11-29/bugfix-hide-search-bar-in-public-links/0 | {
"file_path": "owncloud/web/changelog/6.0.0_2022-11-29/bugfix-hide-search-bar-in-public-links",
"repo_id": "owncloud",
"token_count": 62
} | 676 |
Bugfix: Routing for re-shares
We've fixed a bug where routing into re-shares and their parent folders from the "Shared with others/via link" page was broken.
https://github.com/owncloud/web/pull/7771
https://github.com/owncloud/web/pull/7790
https://github.com/owncloud/web/issues/7347
| owncloud/web/changelog/6.0.0_2022-11-29/bugfix-routing-for-re-shares/0 | {
"file_path": "owncloud/web/changelog/6.0.0_2022-11-29/bugfix-routing-for-re-shares",
"repo_id": "owncloud",
"token_count": 93
} | 677 |
Bugfix: Upload modify time
We've included the `x-oc-mtime` header in upload requests to tell the backend the proper modify date of uploaded resources.
https://github.com/owncloud/web/pull/7630
https://github.com/owncloud/web/pull/7641
https://github.com/owncloud/web/issues/7628
| owncloud/web/changelog/6.0.0_2022-11-29/bugfix-upload-modify-time/0 | {
"file_path": "owncloud/web/changelog/6.0.0_2022-11-29/bugfix-upload-modify-time",
"repo_id": "owncloud",
"token_count": 86
} | 678 |
Enhancement: Friendlier logout screen
We have updated the message and layout of the logout screen to make it a more pleasant user experience.
https://github.com/owncloud/web/pull/7747
https://github.com/owncloud/web/issues/7744
| owncloud/web/changelog/6.0.0_2022-11-29/enhancement-friendlier-logout-screen/0 | {
"file_path": "owncloud/web/changelog/6.0.0_2022-11-29/enhancement-friendlier-logout-screen",
"repo_id": "owncloud",
"token_count": 66
} | 679 |
Bugfix: Archiver in protected public links
Downloading multiple resources as archive in protected public links has been fixed.
https://github.com/owncloud/web/issues/6423
https://github.com/owncloud/web/pull/8466
| owncloud/web/changelog/7.0.0_2023-06-02/bugfix-archiver-public-link/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-archiver-public-link",
"repo_id": "owncloud",
"token_count": 59
} | 680 |
Bugfix: Include spaces in the list info
Spaces have been included in the list info below file lists that support displaying spaces.
https://github.com/owncloud/web/pull/7926
https://github.com/owncloud/web/issues/7924
| owncloud/web/changelog/7.0.0_2023-06-02/bugfix-include-spaces-in-list-info/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-include-spaces-in-list-info",
"repo_id": "owncloud",
"token_count": 62
} | 681 |
Bugfix: "Paste"-action without write permissions
The "Paste"-action is now disabled in read-only folders/shares.
https://github.com/owncloud/web/pull/7925
https://github.com/owncloud/web/issues/7922
| owncloud/web/changelog/7.0.0_2023-06-02/bugfix-paste-without-write-permissions/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-paste-without-write-permissions",
"repo_id": "owncloud",
"token_count": 65
} | 682 |
Bugfix: Selection reset on action click
Clicking a file action from the context menu doesn't reset the selection anymore.
https://github.com/owncloud/web/issues/8776
https://github.com/owncloud/web/pull/8777
| owncloud/web/changelog/7.0.0_2023-06-02/bugfix-selection-reset-on-action-click/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-selection-reset-on-action-click",
"repo_id": "owncloud",
"token_count": 60
} | 683 |
Change: Configurable extension autosave
We have added a global setting in the configuration to enable autosave (and the corresponding timeout) for bundled and external extensions,
instead of having a per-extension configuration which was limited to external extensions.
Handling of the provided autosave needs to be taken care of by the extension itself.
https://github.com/owncloud/web/pull/8455
https://github.com/owncloud/web/pull/8457
https://github.com/owncloud/web/pull/8474
| owncloud/web/changelog/7.0.0_2023-06-02/change-configurable-extension-autosave/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/change-configurable-extension-autosave",
"repo_id": "owncloud",
"token_count": 120
} | 684 |
Enhancement: Admin settings general section
We've introduced the general section in the admin settings app, which displays information about the running
front- and backend.
https://github.com/owncloud/web/issues/8363
https://github.com/owncloud/web/pull/8360
| owncloud/web/changelog/7.0.0_2023-06-02/enhancement-admin-settings-general-section/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-admin-settings-general-section",
"repo_id": "owncloud",
"token_count": 68
} | 685 |
Enhancement: Custom translations
We have added the possibility to include own translations to override existing translations.
To inject custom translations add the following property to your `config.json`, `"customTranslations": [{ "url": "https://localhost:9200/translations.json" }]`.
https://github.com/owncloud/web/pull/8790
https://github.com/owncloud/web/issues/8791
| owncloud/web/changelog/7.0.0_2023-06-02/enhancement-custom-translations/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-custom-translations",
"repo_id": "owncloud",
"token_count": 100
} | 686 |
Enhancement: Rework mobile navigation
The navigation for mobile devices <640px has been reworked.
https://github.com/owncloud/web/issues/8557
https://github.com/owncloud/web/issues/7253
https://github.com/owncloud/web/issues/3774
https://github.com/owncloud/web/issues/9073
https://github.com/owncloud/web/pull/8757
https://github.com/owncloud/web/pull/9074
| owncloud/web/changelog/7.0.0_2023-06-02/enhancement-mobile-navigation/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-mobile-navigation",
"repo_id": "owncloud",
"token_count": 123
} | 687 |
Enhancement: Rename "user management" app
The "user management" app has been renamed to "admin settings" because the app will contain a variety of general settings in the future.
https://github.com/owncloud/web/pull/8175
| owncloud/web/changelog/7.0.0_2023-06-02/enhancement-rename-user-management/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-rename-user-management",
"repo_id": "owncloud",
"token_count": 59
} | 688 |
Enhancement: Add support for multiple clients in `theme.json`
The `theme.json` file now supports multiple clients which are defined via the top-level property. Therefore both web themes have been moved down one level into the new property "web". The change is backwards compatible though, meaning it still works when the web themes are defined top-level in `theme.json`.
https://github.com/owncloud/web/pull/8280
https://github.com/owncloud/enterprise/issues/5502
| owncloud/web/changelog/7.0.0_2023-06-02/enhancement-support-multiple-clients-in-theme-json/0 | {
"file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-support-multiple-clients-in-theme-json",
"repo_id": "owncloud",
"token_count": 116
} | 689 |
Bugfix: Favorites list update on removal
The Favorites list is now updating when a resource is removed from the list in this view
https://github.com/owncloud/web/pull/9078
https://github.com/owncloud/web/pull/9237
| owncloud/web/changelog/7.1.0_2023-08-23/bugfix-favorites-list-update-on-removal/0 | {
"file_path": "owncloud/web/changelog/7.1.0_2023-08-23/bugfix-favorites-list-update-on-removal",
"repo_id": "owncloud",
"token_count": 64
} | 690 |
Enhancement: Allow local storage for auth token
We've introduced a new env var WEB_OPTION_TOKEN_STORAGE_LOCAL, when set to true(default), the auth token will be stored in the
browser's local storage instead the session storage, this will effect in a persisted login state across multiple
browser tabs.
https://github.com/owncloud/web/pull/9386
https://github.com/owncloud/web/issues/9325
| owncloud/web/changelog/7.1.0_2023-08-23/enhancement-allow-local-storage-for-auth-token/0 | {
"file_path": "owncloud/web/changelog/7.1.0_2023-08-23/enhancement-allow-local-storage-for-auth-token",
"repo_id": "owncloud",
"token_count": 108
} | 691 |
Enhancement: Respect archiver limits
The archiver service announces a limit for the accumulated filesize of the currently selected resources.
The web UI now respects those limits and shows a disabled download button once the limit has been reached.
https://github.com/owncloud/web/pull/9055
https://github.com/owncloud/web/issues/8456
| owncloud/web/changelog/7.1.0_2023-08-23/enhancement-respect-archiver-limits/0 | {
"file_path": "owncloud/web/changelog/7.1.0_2023-08-23/enhancement-respect-archiver-limits",
"repo_id": "owncloud",
"token_count": 84
} | 692 |
Bugfix: Respect "details"-query on private links
The "details"-query on private links is now being respected properly when `openLinksWithDefaultApp` is enabled. This fixed an issue where the sidebar would not open despite requesting to do so.
https://github.com/owncloud/web/issues/9868
https://github.com/owncloud/web/pull/9947
| owncloud/web/changelog/7.1.2_2023-11-16/bugfix-respect-details-query/0 | {
"file_path": "owncloud/web/changelog/7.1.2_2023-11-16/bugfix-respect-details-query",
"repo_id": "owncloud",
"token_count": 87
} | 693 |
Bugfix: Icon extension mapping
We have simplified the mapping between file extensions and their display in the web UI (icon and its color).
Now, further formats/extensions (`.tar.gz`,`.tar.xz`,`.bz2`, ...) get displayed correctly.
https://github.com/owncloud/web/issues/10031
https://github.com/owncloud/web/pull/10059
| owncloud/web/changelog/8.0.0_2024-03-08/bugfix-icon-extension-mapping/0 | {
"file_path": "owncloud/web/changelog/8.0.0_2024-03-08/bugfix-icon-extension-mapping",
"repo_id": "owncloud",
"token_count": 94
} | 694 |
Bugfix: Scrollable account page
Vertically scrolling the account page has been fixed and works now.
https://github.com/owncloud/web/pull/10318
https://github.com/owncloud/web/issues/10313
| owncloud/web/changelog/8.0.0_2024-03-08/bugfix-scrollable-account-page/0 | {
"file_path": "owncloud/web/changelog/8.0.0_2024-03-08/bugfix-scrollable-account-page",
"repo_id": "owncloud",
"token_count": 56
} | 695 |
Change: Keyword Query Language (KQL) search syntax
We've introduced [KQL](https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference) as our default query language.
Previously we used our own simple language for queries which is now replaced by kql.
`sample.tx* Tags:important Tags:report Content:annual*`
becomes
`name:"sample.tx*" AND tag:important AND tag:report AND content:"annual*"`
by default KQL uses `AND` as property restriction and the query described above can also be formulated as follows
`name:"sample.tx*" tag:important tag:report content:"annual*"`
More advanced syntax like grouping combined with boolean property restriction is supported too
`(name:"sample*" name:"*txt") tag:important OR tag:report content:"annual*"`
BREAKING CHANGE for developers: the term which will be passed to the `search` method of search providers is now wrapped inside `name:"..."`. If you don't want that behaviour you need to strip it out, e.g. via simple regex: `const rawTerm = term.match(new RegExp('name:"\\*(.*?)\\*"'))`.
https://github.com/owncloud/web/pull/9653
https://github.com/owncloud/web/issues/9636
https://github.com/owncloud/web/issues/9646
| owncloud/web/changelog/8.0.0_2024-03-08/change-kql-search-query-language/0 | {
"file_path": "owncloud/web/changelog/8.0.0_2024-03-08/change-kql-search-query-language",
"repo_id": "owncloud",
"token_count": 350
} | 696 |
Enhancement: Default link permission
When creating a new link, Web now respects the default permissions coming from the server.
https://github.com/owncloud/web/pull/10037
https://github.com/owncloud/web/issues/9919
| owncloud/web/changelog/8.0.0_2024-03-08/enhancement-default-link-permissions/0 | {
"file_path": "owncloud/web/changelog/8.0.0_2024-03-08/enhancement-default-link-permissions",
"repo_id": "owncloud",
"token_count": 60
} | 697 |
Enhancement: Indicate processing state
If a file has been just recently uploaded, it might go trough a processing state (e.G virus scan).
If so, no actions on this resource is possible, therefore we show now the processing state and make
the temporary restrictions clear to the user.
https://github.com/owncloud/web/pull/9561
https://github.com/owncloud/web/pull/9585
https://github.com/owncloud/web/pull/9590
https://github.com/owncloud/web/pull/9596
https://github.com/owncloud/web/issues/9558
| owncloud/web/changelog/8.0.0_2024-03-08/enhancement-indicate-processig-state/0 | {
"file_path": "owncloud/web/changelog/8.0.0_2024-03-08/enhancement-indicate-processig-state",
"repo_id": "owncloud",
"token_count": 145
} | 698 |
Enhancement: Moving share's "set expiration date" function
Moving "set expiration date" function to a three dots menu to help reduce visual load on simple shares in sharing pane
https://github.com/owncloud/web/pull/9584
https://github.com/owncloud/web/pull/9612
https://github.com/owncloud/web/issues/9493
| owncloud/web/changelog/8.0.0_2024-03-08/enhancement-set-expiration-date-in-three-dots-menu/0 | {
"file_path": "owncloud/web/changelog/8.0.0_2024-03-08/enhancement-set-expiration-date-in-three-dots-menu",
"repo_id": "owncloud",
"token_count": 87
} | 699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.