text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
/** * Wrap modal content in modal classes, without modal behaviours */ export function ModalContentDecorator(Story) { return ( <div className="modal-dialog"> <div className="modal-content"> <Story /> </div> </div> ) } export function ModalBodyDecorator(Story) { return ( <div className="modal-body"> <Story /> </div> ) } export function ModalFooterDecorator(Story) { return ( <div className="modal-footer"> <Story /> </div> ) }
overleaf/web/frontend/stories/modals/modal-decorators.js/0
{ "file_path": "overleaf/web/frontend/stories/modals/modal-decorators.js", "repo_id": "overleaf", "token_count": 208 }
545
.account-settings { .alert { margin-bottom: 0; } h3 { margin-top: 0; } } #delete-account-modal { .alert { margin-top: 25px; margin-bottom: 4px; } .confirmation-checkbox-wrapper { padding-top: 8px; input { margin-right: 6px; } } } .affiliations-table { table-layout: fixed; } .affiliations-table-email { width: 40%; } .affiliations-table-institution { width: 40%; } .affiliations-table-inline-actions { padding: 0 !important; text-align: right; word-wrap: break-word; button { margin: @table-cell-padding 0; } } .affiliations-table-inline-action { text-transform: capitalize; } .affiliations-table-inline-action-disabled-wrapper { display: inline-block; } .affiliations-table-highlighted-row { background-color: tint(@content-alt-bg-color, 6%); } .affiliations-table-error-row { background-color: @alert-danger-bg; color: @alert-danger-text; .btn { margin-top: @table-cell-padding; .button-variant( @btn-danger-color; darken(@btn-danger-bg, 8%) ; @btn-danger-border ); } .small { color: @alert-danger-text; } } .affiliations-table-info-row { background-color: @alert-info-bg; color: @alert-info-text; .small { color: @alert-info-text; } } .affiliations-table-warning-row { background-color: @alert-warning-bg; color: @alert-warning-text; .small { color: @alert-warning-text; } } tbody > tr.affiliations-table-saml-row > td:not(.with-border) { border: 0; } tbody > tr.affiliations-table-info-row > td { border: 0; } tbody > tr.affiliations-table-warning-row > td { border: 0; } .affiliations-form-group { margin-top: @table-cell-padding; &:first-child { margin-top: 0; } } .affiliation-change-container, .affiliation-change-actions { margin-top: @table-cell-padding; } .affiliations-table-label { padding-top: 4px; } .btn-link-accounts { margin-bottom: (@line-height-computed / 2) - @table-cell-padding; } .dropbox-sync-icon { position: relative; font-size: 1.3em; line-height: 1.3em; vertical-align: top; &.dropbox-sync-icon-error { color: @alert-danger-bg; } &.dropbox-sync-icon-success { color: @alert-success-bg; } &.dropbox-sync-icon-updating { color: @alert-info-bg; &::after { content: '\f021'; position: absolute; top: 0; left: 50%; margin-left: -20%; font-size: 60%; color: #fff; animation: fa-spin 2s infinite linear; } } }
overleaf/web/frontend/stylesheets/app/account-settings.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/app/account-settings.less", "repo_id": "overleaf", "token_count": 1050 }
546
.modal-hotkeys { font-size: 14px; h3:first-child { margin-top: 0; } .hotkey { margin-bottom: @line-height-computed / 2; } .description { display: inline-block; } .combination { padding: 4px 8px; border-radius: 3px; background-color: @gray-dark; color: white; font-family: @font-family-sans-serif; font-weight: 600; margin-right: @line-height-computed / 4; } }
overleaf/web/frontend/stylesheets/app/editor/hotkeys.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/app/editor/hotkeys.less", "repo_id": "overleaf", "token_count": 185 }
547
#front-chat-holder > div[role='button'] { margin-bottom: @footer-height; }
overleaf/web/frontend/stylesheets/app/front-chat-widget.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/app/front-chat-widget.less", "repo_id": "overleaf", "token_count": 29 }
548
.recurly-hosted-field { &:extend(.form-control); }
overleaf/web/frontend/stylesheets/app/recurly.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/app/recurly.less", "repo_id": "overleaf", "token_count": 25 }
549
.card { background-color: white; border-radius: @border-radius-base; box-shadow: @card-box-shadow; padding: @line-height-computed; .page-header { margin: 0 0 1.5625rem; h1, h2, h3 { margin-top: 0; } } > .container-fluid { padding: 0; } .card-header { border-bottom: 1px solid @gray-lighter; padding-bottom: @line-height-computed; margin-bottom: @line-height-computed; h2 { margin: 0; } } > :first-child { margin-top: 0; } > :last-child { margin-bottom: 0; } } .card-thin { padding: @line-height-computed / 2; } .card-group { .card { margin: @line-height-computed -15px 0 -15px; border-radius: 0; &.card-highlighted { // Make it taller and card like margin-top: 0; border-radius: @border-radius-base; } &.card-first { border-top-left-radius: @border-radius-base; border-bottom-left-radius: @border-radius-base; } &.card-last { border-top-right-radius: @border-radius-base; border-bottom-right-radius: @border-radius-base; } } } .card-border { border: @border-width-base solid @border-color-base; } .card-content { padding: @padding-md; }
overleaf/web/frontend/stylesheets/components/card.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/components/card.less", "repo_id": "overleaf", "token_count": 546 }
550
// // Input groups // -------------------------------------------------- // Base styles // ------------------------- .input-group { position: relative; // For dropdowns display: table; border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table // Undo padding and float of grid classes &[class*='col-'] { float: none; padding-left: 0; padding-right: 0; } .form-control { // Ensure that the input is always above the *appended* addon button for // proper border colors. position: relative; z-index: 2; // IE9 fubars the placeholder attribute in text inputs and the arrows on // select elements in input groups. To fix it, we float the input. Details: // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855 float: left; width: 100%; margin-bottom: 0; } } // Sizing options // // Remix the default form control sizing classes into new ones for easier // manipulation. .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { .input-lg(); } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { .input-sm(); } // Display as table-cell // ------------------------- .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; &:not(:first-child):not(:last-child) { border-radius: 0; } } // Addon and addon wrapper for buttons .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; // Match the inputs } // Text input groups // ------------------------- .input-group-addon { padding: @padding-base-vertical @padding-base-horizontal; font-size: @font-size-base; font-weight: normal; line-height: 1; color: @input-color; text-align: center; background-color: @input-group-addon-bg; border: 1px solid @input-group-addon-border-color; border-radius: @border-radius-base; // Sizing &.input-sm { padding: @padding-small-vertical @padding-small-horizontal; font-size: @font-size-small; border-radius: @border-radius-small; } &.input-lg { padding: @padding-large-vertical @padding-large-horizontal; font-size: @font-size-large; border-radius: @border-radius-large; } // Nuke default margins from checkboxes and radios to vertically center within. input[type='radio'], input[type='checkbox'] { margin-top: 0; } } // Reset rounded corners .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { .border-right-radius(0); } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { .border-left-radius(0); } .input-group-addon:last-child { border-left: 0; } // Button input groups // ------------------------- .input-group-btn { position: relative; // Jankily prevent input button groups from wrapping with `white-space` and // `font-size` in combination with `inline-block` on buttons. font-size: 0; white-space: nowrap; // Negative margin for spacing, position for bringing hovered/focused/actived // element above the siblings. > .btn { position: relative; + .btn { margin-left: -1px; } // Bring the "active" button to the front &:hover, &:focus, &:active { z-index: 2; } } // Negative margin to only have a 1px border between the two &:first-child { > .btn, > .btn-group { margin-right: -1px; } } &:last-child { > .btn, > .btn-group { margin-left: -1px; } } }
overleaf/web/frontend/stylesheets/components/input-groups.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/components/input-groups.less", "repo_id": "overleaf", "token_count": 1524 }
551
// // Pagination (multiple pages) // -------------------------------------------------- .pagination { display: inline-block; padding-left: 0; margin: @line-height-computed 0; border-radius: @border-radius-base; > li { display: inline; // Remove list-style and block-level defaults > a, > button, > span { position: relative; float: left; // Collapse white-space padding: @padding-base-vertical @padding-base-horizontal; line-height: @line-height-base; text-decoration: none; color: @pagination-color; background-color: @pagination-bg; border: 1px solid @pagination-border; margin-left: -1px; } &:first-child { > a, > button, > span { margin-left: 0; .border-left-radius(@border-radius-base); } } &:last-child { > a, > button, > span { .border-right-radius(@border-radius-base); } } } > li > a, > li > button, > li > span { &:hover, &:focus { color: @pagination-hover-color; background-color: @pagination-hover-bg; border-color: @pagination-hover-border; } } > .active > a, > .active > button, > .active > span { &, &:hover, &:focus { z-index: 2; color: @pagination-active-color; background-color: @pagination-active-bg; border-color: @pagination-active-border; cursor: default; } } > .disabled { > span, > span:hover, > span:focus, > a, > a:hover, > a:focus, > button, > button:hover, > button:focus { color: @pagination-disabled-color; background-color: @pagination-disabled-bg; border-color: @pagination-disabled-border; cursor: not-allowed; } } .ellipses { pointer-events: none; } } // Sizing // -------------------------------------------------- // Large .pagination-lg { .pagination-size( @padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large ); } // Small .pagination-sm { .pagination-size( @padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small ); }
overleaf/web/frontend/stylesheets/components/pagination.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/components/pagination.less", "repo_id": "overleaf", "token_count": 964 }
552
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ // // 1. Set default font family to sans-serif. // 2. Prevent iOS text size adjust after orientation change, without disabling // user zoom. // html { font-family: sans-serif; // 1 -ms-text-size-adjust: 100%; // 2 -webkit-text-size-adjust: 100%; // 2 } // // Remove default margin. // body { margin: 0; } // HTML5 display definitions // ========================================================================== // // Correct `block` display not defined in IE 8/9. // article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } // // 1. Correct `inline-block` display not defined in IE 8/9. // 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. // audio, canvas, progress, video { display: inline-block; // 1 vertical-align: baseline; // 2 } // // Prevent modern browsers from displaying `audio` without controls. // Remove excess height in iOS 5 devices. // audio:not([controls]) { display: none; height: 0; } // // Address `[hidden]` styling not present in IE 8/9. // Hide the `template` element in IE, Safari, and Firefox < 22. // [hidden], template { display: none; } // Links // ========================================================================== // // Remove the gray background color from active links in IE 10. // a { background: transparent; } // // Improve readability when focused and also mouse hovered in all browsers. // a:active, a:hover { outline: 0; } // Text-level semantics // ========================================================================== // // Address styling not present in IE 8/9, Safari 5, and Chrome. // abbr[title] { border-bottom: 1px dotted; } // // Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. // b, strong { font-weight: bold; } // // Address styling not present in Safari 5 and Chrome. // dfn { font-style: italic; } // // Address variable `h1` font-size and margin within `section` and `article` // contexts in Firefox 4+, Safari 5, and Chrome. // h1 { font-size: 2em; margin: 0.67em 0; } // // Address styling not present in IE 8/9. // mark { background: #ff0; color: #000; } // // Address inconsistent and variable font size in all browsers. // small { font-size: 80%; } // // Prevent `sub` and `sup` affecting `line-height` in all browsers. // sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } // Embedded content // ========================================================================== // // Remove border when inside `a` element in IE 8/9. // img { border: 0; } // // Correct overflow displayed oddly in IE 9. // svg:not(:root) { overflow: hidden; } // Grouping content // ========================================================================== // // Address margin not present in IE 8/9 and Safari 5. // figure { margin: 1em 40px; } // // Address differences between Firefox and other browsers. // hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } // // Contain overflow in all browsers. // pre { overflow: auto; } // // Address odd `em`-unit font size rendering in all browsers. // code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } // Forms // ========================================================================== // // Known limitation: by default, Chrome and Safari on OS X allow very limited // styling of `select`, unless a `border` property is set. // // // 1. Correct color not being inherited. // Known issue: affects color of disabled elements. // 2. Correct font properties not being inherited. // 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. // button, input, optgroup, select, textarea { color: inherit; // 1 font: inherit; // 2 margin: 0; // 3 } // // Address `overflow` set to `hidden` in IE 8/9/10. // button { overflow: visible; } // // Address inconsistent `text-transform` inheritance for `button` and `select`. // All other form control elements do not inherit `text-transform` values. // Correct `button` style inheritance in Firefox, IE 8+, and Opera // Correct `select` style inheritance in Firefox. // button, select { text-transform: none; } // // 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` // and `video` controls. // 2. Correct inability to style clickable `input` types in iOS. // 3. Improve usability and consistency of cursor style between image-type // `input` and others. // button, html input[type="button"], // 1 input[type="reset"], input[type="submit"] { -webkit-appearance: button; // 2 cursor: pointer; // 3 } // // Re-set default cursor for disabled elements. // button[disabled], html input[disabled] { cursor: default; } // // Remove inner padding and border in Firefox 4+. // button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } // // Address Firefox 4+ setting `line-height` on `input` using `!important` in // the UA stylesheet. // input { line-height: normal; } // // It's recommended that you don't attempt to style these elements. // Firefox's implementation doesn't respect box-sizing, padding, or width. // // 1. Address box sizing set to `content-box` in IE 8/9/10. // 2. Remove excess padding in IE 8/9/10. // input[type='checkbox'], input[type='radio'] { box-sizing: border-box; // 1 padding: 0; // 2 } // // Fix the cursor style for Chrome's increment/decrement buttons. For certain // `font-size` values of the `input`, it causes the cursor style of the // decrement button to change from `default` to `text`. // input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { height: auto; } // // 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. // 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome // (include `-moz` to future-proof). // input[type='search'] { -webkit-appearance: textfield; // 1 -moz-box-sizing: content-box; -webkit-box-sizing: content-box; // 2 box-sizing: content-box; } // // Remove inner padding and search cancel button in Safari and Chrome on OS X. // Safari (but not Chrome) clips the cancel button when the search input has // padding (and `textfield` appearance). // input[type='search']::-webkit-search-cancel-button, input[type='search']::-webkit-search-decoration { -webkit-appearance: none; } // // Define consistent border, margin, and padding. // fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } // // 1. Correct `color` not being inherited in IE 8/9. // 2. Remove padding so people aren't caught out if they zero out fieldsets. // legend { border: 0; // 1 padding: 0; // 2 } // // Remove default vertical scrollbar in IE 8/9. // textarea { overflow: auto; } // // Don't inherit the `font-weight` (applied by a rule above). // NOTE: the default cannot safely be changed in Chrome and Safari on OS X. // optgroup { font-weight: bold; } // Tables // ========================================================================== // // Remove most spacing between table cells. // table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; }
overleaf/web/frontend/stylesheets/core/normalize.less/0
{ "file_path": "overleaf/web/frontend/stylesheets/core/normalize.less", "repo_id": "overleaf", "token_count": 2378 }
553
.plv-highlights-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; } .plv-highlights-layer > div { display: block; position: absolute; pointer-events: auto; background-color: yellow; opacity: 0.4; }
overleaf/web/frontend/stylesheets/vendor/pdfListView/HighlightsLayer.css/0
{ "file_path": "overleaf/web/frontend/stylesheets/vendor/pdfListView/HighlightsLayer.css", "repo_id": "overleaf", "token_count": 106 }
554
{ "invalid_password": "パスワードの入力に誤りがあります", "error": "エラー", "other_actions": "その他の操作", "email_sent": "メールが送信されました", "create_first_admin_account": "初めての管理者アカウントの作成", "ldap": "LDAP", "status_checks": "ステータスの確認", "editor_resources": "エディターの資源", "checking": "確認中", "cannot_invite_non_user": "招待を送信することができません。受信者が__appName__アカウントを所持している必要があります。", "log_in_with": "__provider__ でログイン", "return_to_login_page": "ログインページに戻る", "login_failed": "ログイン失敗", "delete_account_warning_message_3": "プロジェクトや設定などの <strong> アカウントのデータをすべて削除 </strong> しようとしています。続行するには下のボックスにお客さまのアカウントのメールアドレスとパスワードを入力してください。", "delete_account_warning_message_2": "プロジェクトや設定などの <strong> アカウントデータをすべて削除 </strong> しようとしています。続行するには下のボックスにお客さまのアカウントのメールアドレスを入力してください。", "your_sessions": "あなたのセッション", "clear_sessions_description": "これはお客さまのアカウントでアクティブなセッション(ログイン)の一覧です。現在のセッションは含まれていません。下の「セッションのクリア」ボタンをクリックしてログアウトします。", "no_other_sessions": "他にアクティブなセッションはありません", "ip_address": "IPアドレス", "session_created_at": "作成されたセッション", "clear_sessions": "セッションのクリア", "clear_sessions_success": "セッションがクリアされました", "sessions": "セッション", "manage_sessions": "セッションの管理", "syntax_validation": "コードチェック", "history": "履歴", "joining": "参加中", "open_project": "プロジェクトを開く", "files_cannot_include_invalid_characters": "ファイルには「*」や「/」などの文字を含めることはできません", "invalid_file_name": "無効なファイル名", "autocomplete_references": "参照オートコンプリート(<code>\\cite{}</code>ブロック内)", "autocomplete": "オートコンプリート", "failed_compile_check": "コンパイルする前に修正すべき重大なシンタックスエラーがプロジェクトにあるようです", "failed_compile_check_try": "とにかくコンパイルを実行", "failed_compile_option_or": "あるいは", "failed_compile_check_ignore": "シンタックスチェックを終了", "compile_time_checks": "シンタックスチェック", "stop_on_validation_error": "コンパイルの前にシンタックスをチェック", "ignore_validation_errors": "シンタックスをチェックしない", "run_syntax_check_now": "今すぐシンタックスチェックを実行", "your_billing_details_were_saved": "お客さまの請求書情報が保存されました", "security_code": "セキュリティコード", "paypal_upgrade": "アップグレードするには、下のボタンをクリックし、メールアドレスとパスワードを入力してPayPalにログインしてください。", "upgrade_cc_btn": "今すぐアップグレード、支払いは1週間後", "upgrade_paypal_btn": "続行", "notification_project_invite": "<b>__userName__</b>が<b>__projectName__</b> への参加を求めています<a class=\"btn btn-sm btn-info pull-right\" href=\"/project/__projectId__/invite/token/__token__\">プロジェクトに参加</a>", "file_restored": "ファイル(__filename__)が復元されました。", "file_restored_back_to_editor": "エディターに戻ってもう一度作業をすることができます。", "file_restored_back_to_editor_btn": "エディターに戻る", "view_project": "プロジェクトの表示", "join_project": "プロジェクトに参加", "invite_not_accepted": "招待はまだ承認されていません", "resend": "再送信", "syntax_check": "シンタックスチェック", "revoke_invite": "招待のキャンセル", "pending": "承認待ち", "invite_not_valid": "これは有効なプロジェクト招待ではありません", "invite_not_valid_description": "招待の有効期限が切れている可能性があります。プロジェクトオーナーにお問い合わせください", "accepting_invite_as": "この招待を以下のメールアドレスで承認します", "accept_invite": "招待の承認", "log_hint_ask_extra_feedback": "このヒントが役に立たなかった", "log_hint_extra_feedback_didnt_understand": "ヒントが理解できませんでした", "log_hint_extra_feedback_not_applicable": "このソリューションをドキュメントに適用できません", "log_hint_extra_feedback_incorrect": "これではエラーを修正できません", "log_hint_extra_feedback_other": "その他:", "log_hint_extra_feedback_submit": "提出", "if_you_are_registered": "すでに登録している場合", "stop_compile": "コンパイルの停止", "terminated": "コンパイルがキャンセルされました", "compile_terminated_by_user": "「コンパイルの中止」ボタンを押してコンパイルがキャンセルされました。RAWログを表示して、コンパイルが停止した場所を確認することができます。", "site_description": "簡単に使用できるオンラインLaTeXエディター。インストール不要、リアルタイムコラボレーション、バージョン管理、何百種類のLaTeXテンプレートなど多数の機能。", "knowledge_base": "知識ベース", "contact_message_label": "メッセージ", "kb_suggestions_enquiry": "当社の <0>__kbLink__</0> を確認しましたか?", "answer_yes": "はい", "answer_no": "いいえ", "log_hint_extra_info": "詳しく見る", "log_hint_feedback_label": "このヒントは役に立ちましたか?", "log_hint_feedback_gratitude": "ご意見ありがとうございます!", "recompile_pdf": "PDFを再コンパイル", "about_paulo_reis": "ポルトガルのアヴェイロ在住のフロントエンドソフトウェア開発者およびユーザーエクスペリエンス研究者。パウロはユーザーエクスペリエンスの博士号を持ち、コンセプトやテスト・認証、デザインや実装において、人の使い方に合わせてテクノロジーを応用させることに情熱を傾けています。", "login_or_password_wrong_try_again": "ログイン情報またはパスワードが正しくありません。再度お試しください", "manage_beta_program_membership": "ベータプログラムメンバーシップを管理", "beta_program_opt_out_action": "ベータプログラムからオプトアウト", "disable_beta": "ベータを無効", "beta_program_badge_description": "__appName__の使用中は、ベータ機能にこのバッジが付いています:", "beta_program_current_beta_features_description": "以下の新機能はベータ版で現在テスト中です:", "enable_beta": "ベータを許可", "user_in_beta_program": "ユーザーはベータプログラムに参加しています", "beta_program_already_participating": "ベータプログラムに参加しています。", "sharelatex_beta_program": "__appName__ベータプログラム", "beta_program_benefits": "当社は絶えず__appName__を改善しています。当社のベータプログラムに参加することによって、新しい機能にいち早くアクセスし、当社がお客さまのニーズをより良く理解できるようサポートすることができます。", "beta_program_opt_in_action": "ベータプログラムにオプトイン", "conflicting_paths_found": "競合パスが見つかりました", "following_paths_conflict": "次のファイルとフォルダーは同一のパスと競合しています", "open_a_file_on_the_left": "左のファイルを開く", "reference_error_relink_hint": "エラーが継続して発生する場合は、こちらでアカウントを再リンク付けしてください:", "pdf_rendering_error": "PDFレンダリングエラー", "something_went_wrong_rendering_pdf": "このPDFのレンダリング中にエラーが発生しました。", "mendeley_reference_loading_error_expired": "Mendeleyトークンの期限が切れました。アカウントを再リンク付けしてください", "zotero_reference_loading_error_expired": "Zoteroトークンの期限が切れました。アカウントを再リンクしてください", "mendeley_reference_loading_error_forbidden": "Mendeleyのリファレンスを読み込むことができませんでした。アカウントを再リンクして、再度お試しください", "zotero_reference_loading_error_forbidden": "Zoteroのリファレンスを読み込むことができませんでした。アカウントを再リンクして、再度お試しください", "mendeley_integration": "Mendeley統合", "mendeley_sync_description": "Mendeleyを統合すると、Mendeleyから__appName__プロジェクトにリファレンスをインポートすることができます", "mendeley_is_premium": "Mendeley統合はプレミアム機能です", "link_to_mendeley": "Mendeleyのリンク", "unlink_to_mendeley": "Mendeleyのリンク解除", "mendeley_reference_loading": "Mendeleyからリファレンスを読み込み中", "mendeley_reference_loading_success": "Mendeleyからリファレンスを読み込みました", "mendeley_reference_loading_error": "エラー。Mendeleyからリファレンスを読み込むことができませんでした", "zotero_integration": "Zotero統合。", "zotero_sync_description": "Zoteroを統合すると、Zoteroから__appName__プロジェクトにリファレンスをインポートすることができます。", "zotero_is_premium": "Zotero統合はプレミアム機能です", "link_to_zotero": "Zoteroのリンク", "unlink_to_zotero": "Zoteroのリンク解除", "zotero_reference_loading": "Zoteroからリファレンスの読み込み中", "zotero_reference_loading_success": "Zoteroからリファレンスを読み込みました", "zotero_reference_loading_error": "エラー。Zoteroからリファレンスを読み込むことができませんでした", "reference_import_button": "リファレンスをインポート", "unlink_reference": "リファレンスプロバイダーのリンク解除", "unlink_warning_reference": "警告:このプロバイダーからアカウントをリンク解除すると、リファレンスをプロジェクトにインポートすることができなくなります。", "mendeley": "Mendeley", "zotero": "Zotero", "suggest_new_doc": "新しいドキュメントの提案", "request_sent_thank_you": "リクエストが送信されました。ありがとうございます。", "suggestion": "提案", "project_url": "影響を受けたプロジェクトURL", "subject": "件名", "confirm": "確認", "cancel_personal_subscription_first": "個人購読をすでに申し込んでいます。これをキャンセルしてグループライセンスに参加しますか?", "delete_projects": "プロジェクトの削除", "leave_projects": "プロジェクトを退出", "delete_and_leave_projects": "プロジェクトを削除・退出", "too_recently_compiled": "プロジェクトは最近コンパイルされました。そのため、このコンパイルはスキップされました。", "clsi_maintenance": "コンパイルサーバーはメンテナンス中です。間もなく復旧します。", "references_search_hint": "Ctrl+Spaceを押して検索", "ask_proj_owner_to_upgrade_for_references_search": "アップグレードして参照検索機能を使用するには、プロジェクトオーナーにお問い合わせください。", "ask_proj_owner_to_upgrade_for_faster_compiles": "アップグレードしてコンパイルをすばやくしタイムアウト制限を上げるには、プロジェクトオーナーにお問い合わせください。", "search_bib_files": "作成者、タイトル、年ごとに検索", "leave_group": "グループを退出", "leave_now": "今すぐ退出", "sure_you_want_to_leave_group": "このグループから本当に退出しますか?", "notification_group_invite": "__groupName__への参加を招待されました。<a href=\"/user/subscription/__subscription_id__/group/invited\">こちらから参加</a>。", "search_references": "このプロジェクトの.bibファイルを検索", "no_search_results": "検索結果なし", "email_already_registered": "このメールアドレスはすでに登録されています", "compile_mode": "コンパイルモード", "normal": "ノーマル", "fast": "ファスト", "rename_folder": "フォルダーの名前の変更", "delete_folder": "フォルダーの削除", "about_to_delete_folder": "次のフォルダーを削除しようとしています(フォルダーに含まれるプロジェクトは削除されません):", "to_modify_your_subscription_go_to": "購読を変更するには、次に進んでください", "manage_subscription": "購読管理", "activate_account": "アカウントのアクティベート", "yes_please": "はい、お願いします!", "nearly_activated": "あと一歩であなたの__appName__アカウントがアクティべートされます!", "please_set_a_password": "パスワードを設定してください", "activation_token_expired": "アクティベーショントークンの期限が切れています。新しいトークンが必要となります。", "activate": "アクティベート", "activating": "アクティベート中", "ill_take_it": "これにします!", "cancel_your_subscription": "購読を中止", "no_thanks_cancel_now": "結構です - 今すぐキャンセルします", "cancel_my_account": "購読をキャンセル", "sure_you_want_to_cancel": "キャンセルしてもよろしいですか?", "i_want_to_stay": "留まります", "have_more_days_to_try": "トライアルがまだ<strong>__days__ 日</strong>残っています!", "interested_in_cheaper_plan": "よりお手頃な<strong>__price__</strong>生徒プランに興味がありますか?", "session_expired_redirecting_to_login": "セッション期限切れ。__seconds__秒後にログインぺージにリダイレクトします", "maximum_files_uploaded_together": "最大 __max__ファイルを一緒にアップロード", "too_many_files_uploaded_throttled_short_period": "あまりにも多くのファイルがアップロードされました。アップロードがしばらく調整されます。", "compile_larger_projects": "大きなプロジェクトをコンパイル", "upgrade_to_get_feature": "__feature__のアップグレードを取得、プラス:", "new_group": "新しいグループ", "about_to_delete_groups": "次のグループを削除しようとしています:", "removing": "削除中", "adding": "追加中", "groups": "グループ", "rename_group": "グループの名前の変更", "renaming": "名前の変更中", "create_group": "グループの作成", "delete_group": "グループの削除", "delete_groups": "グループの削除", "your_groups": "あなたのグループ", "group_name": "グループ名", "no_groups": "グループなし", "Subscription": "購読", "Documentation": "ドキュメンテーション", "Universities": "大学", "Account Settings": "アカウントの設定", "Projects": "プロジェクト", "Account": "アカウント", "global": "グローバル", "Terms": "規約", "Security": "セキュリティ", "About": "概要", "editor_disconected_click_to_reconnect": "エディターの接続が切れました。どこかをクリックして再接続。", "word_count": "文字数", "please_compile_pdf_before_word_count": "文字数を計算する前にプロジェクトをコンパイルしてください", "total_words": "合計文字数", "headers": "ヘッダー", "math_inline": "マスインライン", "math_display": "マスディスプレイ", "connected_users": "接続したユーザー", "projects": "プロジェクト", "upload_project": "プロジェクトのアップロード", "all_projects": "すべてのプロジェクト", "your_projects": "あなたのプロジェクト", "shared_with_you": "シェアされたプロジェクト", "deleted_projects": "削除されたプロジェクト", "templates": "テンプレート", "new_folder": "新規フォルダ", "create_your_first_project": "最初のプロジェクトを作成!", "complete": "完了", "on_free_sl": "__appName__ の無料版を使用しています", "upgrade": "アップグレード", "or_unlock_features_bonus": "あるいは無料ボーナス機能を獲得", "sharing_sl": "__appName__ を共有中", "add_to_folder": "フォルダに追加", "create_new_folder": "新規フォルダの作成", "more": "さらに", "rename": "名前の変更", "make_copy": "コピーを作成", "restore": "戻す", "title": "タイトル", "last_modified": "最終変更", "no_projects": "プロジェクトはありません", "welcome_to_sl": "__appName__ にようこそ!", "new_to_latex_look_at": "LaTeXは初めてですか? まずは次のことから始めてください", "or": "または", "or_create_project_left": "あるいは、左で最初のプロジェクトを作成してください。", "thanks_settings_updated": "ありがとうございます。設定が更新されました。", "update_account_info": "アカウント情報の更新", "must_be_email_address": "有効なメールアドレスを入力してください", "first_name": "名", "last_name": "姓", "update": "更新", "change_password": "パスワードの変更", "current_password": "現在のパスワード", "new_password": "新しいパスワード", "confirm_new_password": "新しいパスワードの再入力", "required": "必須", "doesnt_match": "不一致", "dropbox_integration": "Dropboxとの連携", "learn_more": "さらに詳しく", "dropbox_is_premium": "Dropboxとの同期はプレミアム機能です", "account_is_linked": "アカウントはリンクされています", "unlink_dropbox": "Dropboxとの接続を解除", "link_to_dropbox": "Dropboxと接続", "newsletter_info_and_unsubscribe": "数ヶ月毎に新機能を紹介するニュースレターをお送りします。 このメールの購読を希望しない場合はいつでも解除できます。", "unsubscribed": "未購読", "unsubscribing": "購読解除処理中", "unsubscribe": "購読中止", "need_to_leave": "アカウントを離れますか?", "delete_your_account": "アカウントの削除", "delete_account": "アカウントの削除", "delete_account_warning_message": "プロジェクトと設定を含む<strong>あなたの全てのアカウントデータ完全に消去</strong>しようとしています。続行するには下のボックスにお客さまのアカウントのメールアドレスを入力してください。", "deleting": "削除中", "delete": "削除", "sl_benefits_plans": "__appName__ は、世界で最も簡単に使えるLaTeXエディターです。共同編集者と最新情報を共有しながら、作業の変更状況を記録し、世界のどこからでも当社のLaTeX環境を利用できます。", "monthly": "月額", "personal": "個人", "free": "無料", "one_collaborator": "共同編集者1人のみ", "collaborator": "共同編集者", "collabs_per_proj": "プロジェクトあたりの __collabcount__ 共同編集者", "full_doc_history": "すべてのドキュメントの履歴", "sync_to_dropbox": "Dropboxとの同期", "start_free_trial": "無料トライアルを開始!", "professional": "プロフェッショナル", "unlimited_collabs": "無制限の共同編集者", "name": "名前", "student": "学生", "university": "大学", "position": "役職", "choose_plan_works_for_you": "__len__ 日間の無料トライアルであなたにぴったりのプランを選択してください。いつでもキャンセルできます。", "interested_in_group_licence": "グループ、チーム、部署全体のアカウントで __appName__ を使用することに興味がありますか?", "get_in_touch_for_details": "詳細はお問い合わせください!", "group_plan_enquiry": "グループプランの問い合わせ", "enjoy_these_features": "便利な機能をすべてお楽しみください", "create_unlimited_projects": "必要な数のプロジェクトを作成。", "never_loose_work": "立ち止まらないように、わたしたちがサポートします。", "access_projects_anywhere": "どこでもあなたのプロジェクトにアクセス。", "log_in": "ログイン", "login": "ログイン", "logging_in": "ログイン中", "forgot_your_password": "パスワード紛失", "password_reset": "パスワードの再設定", "password_reset_email_sent": "パスワードの再設定を完了するためのメールを送信しました。", "please_enter_email": "メールアドレスを入力してください", "request_password_reset": "パスワード再設定のリクエスト", "reset_your_password": "パスワードの再設定", "password_has_been_reset": "あなたのパスワードはリセットされました", "login_here": "ここからログイン", "set_new_password": "新しいパスワードの設定", "user_wants_you_to_see_project": "__username__ が __projectname__ への参加を求めています。", "join_sl_to_view_project": "__appName__ に参加してこのプロジェクトを表示", "register_to_edit_template": "__templateName__ テンプレートを編集するには登録してください", "already_have_sl_account": "__appName__ のアカウントをすでにお持ちですか?", "register": "登録する", "password": "パスワード", "registering": "登録中", "planned_maintenance": "定期メンテナンス", "no_planned_maintenance": "現在予定されているメンテナンスはありません", "cant_find_page": "申し訳ありません。お探しのページは見つかりませんでした。", "take_me_home": "元に戻る!", "no_preview_available": "申し訳ありません。プレビューは利用できません。", "no_messages": "メッセージはありません", "send_first_message": "最初のメッセージを送信", "account_not_linked_to_dropbox": "あなたのアカウントはDropboxと接続されていません", "update_dropbox_settings": "Dropboxの設定を更新", "refresh_page_after_starting_free_trial": "無料体験を開始したらにこのページの再読み込みを行ってください。", "checking_dropbox_status": "Dropboxの状態を確認中", "dismiss": "破棄", "new_file": "新規ファイル", "upload_file": "ファイルのアップロード", "create": "作成", "creating": "作成中", "upload_files": "ファイルのアップロード", "sure_you_want_to_delete": "以下のファイルを完全に消去しますか?", "common": "共通", "navigation": "ナビゲーション", "editing": "編集中", "ok": "OK", "source": "ソース", "actions": "操作", "copy_project": "プロジェクトのコピー", "publish_as_template": "テンプレートとして公開", "sync": "同期", "settings": "設定", "main_document": "主要文書", "off": "オフ", "auto_complete": "オートコンプリート", "theme": "テーマ", "font_size": "フォントサイズ", "pdf_viewer": "PDFビューア", "built_in": "組み込み", "native": "ネイティブ", "show_hotkeys": "ショートカットキーの表示", "new_name": "新しい名前", "copying": "コピー中", "copy": "コピーする", "compiling": "コンパイル中", "click_here_to_preview_pdf": "こちらをクリックしてPDFで作業をプレビュー表示", "server_error": "サーバーエラー", "somthing_went_wrong_compiling": "申し訳ありませんが、なんらかの理由によりあなたのプロジェクトはコンパイルできませんでした。しばらく経ってから再度お試しください。", "timedout": "タイムアウト", "proj_timed_out_reason": "申し訳ありません。編集に時間がかかりすぎたため、タイムアウトしました。高解像度の画像あるいは複雑な図表が多いことが原因である可能性があります。", "no_errors_good_job": "エラーはありません!", "compile_error": "コンパイルエラー", "generic_failed_compile_message": "申し訳ありません。何らかの理由であなたのLaTeXコードは編集できませんでした。下記のエラーで詳細を確認するか、RAW記録を確認してください", "other_logs_and_files": "他のログとファイル", "view_raw_logs": "RAW記録を表示", "hide_raw_logs": "RAW記録を非表示", "clear_cache": "キャッシュのクリア", "clear_cache_explanation": "当社の編集サーバーから隠れたLaTeXファイル(.aux、.bblなど)をすべて明らかにできます。レファレンスの問題がないかぎりは、一般的にこれを行う必要はありません。", "clear_cache_is_safe": "あなたのプロジェクトファイルは削除・変更されません", "clearing": "削除中", "template_description": "テンプレート説明", "project_last_published_at": "プロジェクトの最終公開日", "problem_talking_to_publishing_service": "公開サービスに問題が発生しました。数分後に再度お試しください。", "unpublishing": "非公開", "republish": "再公開", "publishing": "公開中", "share_project": "プロジェクトの共有", "this_project_is_private": "このプロジェクトは非公開であり以下の方のみがアクセス可能です。", "make_public": "公開する", "this_project_is_public": "このプロジェクトは公開されておりURLを知っている人なら誰でも編集可能です。", "make_private": "非公開にする", "can_edit": "編集可能", "share_with_your_collabs": "共同編集者と共有", "share": "共有", "need_to_upgrade_for_more_collabs": "共同編集者をさらに追加するためにはアカウントのアップグレードが必要です。", "make_project_public": "プロジェクトを公開する", "make_project_public_consequences": "プロジェクトを公開した場合、URLを知っている人なら誰でもアクセスが可能になります。", "allow_public_editing": "全員に編集を許可する", "allow_public_read_only": "全員に閲覧のみ許可する", "make_project_private": "プロジェクトを非公開にする", "make_project_private_consequences": "プロジェクトを非公開にする場合、共有範囲に選択した人だけがアクセスできます。", "need_to_upgrade_for_history": "変更履歴機能を使用するためにはアカウントのアップグレードが必要です。", "ask_proj_owner_to_upgrade_for_history": "アップグレードして履歴機能を使えるようにするには、プロジェクト管理者に問い合わせください。", "anonymous": "匿名", "generic_something_went_wrong": "申し訳ありません。エラーが発生しました", "restoring": "復元中", "restore_to_before_these_changes": "変更前に戻す", "profile_complete_percentage": "あなたのプロフィールは __percentval__%完了しています", "file_has_been_deleted": "__filename__は削除されました", "sure_you_want_to_restore_before": "本当に <0>__filename__</0> を __date__ の変更前に戻しますか?", "rename_project": "プロジェクト名を変更", "about_to_delete_projects": "次ののプロジェクトを削除します:", "about_to_leave_projects": "次のプロジェクトから離れようとしています:", "upload_zipped_project": "ZIPプロジェクトのアップロード", "upload_a_zipped_project": "ZIPプロジェクトのアップロード", "your_profile": "あなたのプロフィール", "institution": "組織", "role": "役", "folders": "フォルダ", "disconnected": "非接続", "please_refresh": "続行するにはページの再読み込みを行ってください", "lost_connection": "接続がありません", "reconnecting_in_x_secs": "__seconds__秒後に再接続", "try_now": "今すぐ試す", "reconnecting": "再接続中", "saving_notification_with_seconds": "__docname__の保存中 (最後の保存から__seconds__秒経過)", "help_us_spread_word": "__appName__ の普及にご協力ください", "share_sl_to_get_rewards": "__appName__ を友だちや同僚と共有して、次の特典を獲得", "post_on_facebook": "Facebookで投稿", "share_us_on_googleplus": "Google+で共有", "email_us_to_your_friends": "友だちにメールで教える", "link_to_us": "あなたのサイトにリンクを置く", "direct_link": "ダイレクトリンク", "sl_gives_you_free_stuff_see_progress_below": "あなたの推薦によって誰かが __appName__ を使い始めたときは、感謝の気持ちとして<strong>無料プレゼント</strong>をお贈りします! 下記で状況を確認してください。", "spread_the_word_and_fill_bar": "名前を広めると、このバーが貯まります", "one_free_collab": "1人の無料共同編集者", "three_free_collab": "3人の無料共同編集者", "free_dropbox_and_history": "無料Dropbox・履歴", "you_not_introed_anyone_to_sl": "まだ誰にも __appName__ を紹介していません。シェアしましょう!", "you_introed_small_number": " <0>__numberOfPeople__</0> 人に __appName__ を紹介しました。ありがとうございます。まだ他にも紹介できませんか?", "you_introed_high_number": " <0>__numberOfPeople__</0> 人に __appName__ を紹介しました。ありがとうございます。", "link_to_sl": "__appName__ にリンク", "can_link_to_sl_with_html": "次のHTMLで __appName__ にリンクすることができます:", "year": "年", "month": "月", "subscribe_to_this_plan": "このプランに加入する", "your_plan": "現在のプラン", "your_subscription": "あなたの購読内容", "on_free_trial_expiring_at": "__expiresAt__に期限が切れる無料トライアルを現在使用しています。", "choose_a_plan_below": "下のプランを選択して定期購読する。", "currently_subscribed_to_plan": "あなたは現在 <0>__planName__</0> プランを購読しています。", "change_plan": "プランの変更", "next_payment_of_x_collectected_on_y": "<0>__paymentAmmount__</0> の次回の支払いは<1>__collectionDate__</1>に集金されます", "update_your_billing_details": "支払明細の更新", "subscription_canceled_and_terminate_on_x": " あなたの購読はキャンセルされ、<0>__terminateDate__</0> に終了します。今後支払いが発生することはありません。", "your_subscription_has_expired": "あなたの購読は有効期限切れです。", "create_new_subscription": "新しい購読の作成", "problem_with_subscription_contact_us": "定期購読に問題が発生しました。詳細については当社にお問い合わせください。", "manage_group": "管理グループ", "loading_billing_form": "支払い明細フォームの読み込み中", "you_have_added_x_of_group_size_y": "<1>__groupSize__</1> メンバーの <0>__addedUsersSize__</0> を追加しました。", "remove_from_group": "グループから削除", "group_account": "グループアカウント", "registered": "登録済み", "no_members": "メンバーはいません", "add_more_members": "メンバーの追加", "add": "追加", "thanks_for_subscribing": "購読ありがとうございます!", "your_card_will_be_charged_soon": "すぐにカードに請求されます。", "if_you_dont_want_to_be_charged": "今後請求されたくない場合は", "add_your_first_group_member_now": "最初のグループメンバーを今すぐ追加", "thanks_for_subscribing_you_help_sl": "__planName__ プランの購読をありがとうございます。あなたのようなサポートが __appName__ の成長を後押ししてくれます。", "back_to_your_projects": "プロジェクトに戻る", "goes_straight_to_our_inboxes": "両方の受信箱に届きます", "need_anything_contact_us_at": "必要なことがございましたら、いつでもごこちらまで連絡ください", "regards": "よろしくお願いいたします", "about": "概要", "comment": "コメント", "restricted_no_permission": "制限されています。申し訳ありません。このページを読み込む許可が与えられていません。", "online_latex_editor": "オンラインLaTeXエディター", "meet_team_behind_latex_editor": "お気に入りのオンラインLaTeXエディターのチームと会う", "follow_me_on_twitter": "Twitterでフォローする", "motivation": "モチベーション", "evolved": "進化", "the_easy_online_collab_latex_editor": "簡単に使えるオンラインの共同LaTeXエディター", "get_started_now": "今すぐ開始", "sl_used_over_x_people_at": "__appName__ は、__numberOfUsers__ 以上の生徒と大学で使用されています:", "collaboration": "コラボレーション", "work_on_single_version": "1つのバージョンで共同作業", "view_collab_edits": "共同編集者による編集を表示", "ease_of_use": "使いやすい", "no_complicated_latex_install": "複雑なLaTeXのインストールは不要", "all_packages_and_templates": "必要なパッケージと <0>__templatesLink__</0> がすべて", "document_history": "文書履歴", "see_what_has_been": "今までの内容を表示 ", "added": "追加", "and": "と", "removed": "削除", "restore_to_any_older_version": "旧バージョンに戻す", "work_from_anywhere": "どこからでも仕事ができます", "acces_work_from_anywhere": "世界のどこからでもあなたの仕事にアクセス", "work_offline_and_sync_with_dropbox": "オフラインで仕事して、DropboxとGitHubでファイルを同期", "over": "以上", "view_templates": "テンプレート表示", "nothing_to_install_ready_to_go": "インストールするのは複雑でも難しくもありません。今まで見たことがなくても、<0>__start_now__</0> できます。__appName__ には、当社のサーバーで働く完璧に整備されたLaTeX環境が用意されています。", "start_using_latex_now": "今すぐLaTeXを使い始める", "get_same_latex_setup": "__appName__ があれば、どこでも同じLaTeXセットアップを利用できます。__appName__ で同僚や生徒と一緒に働くことで、まだ見つかっていないバージョンの不一致やパッケージの衝突を調べることができます。", "support_lots_of_features": "当社はほぼすべてのLaTeX機能をサポートしています。画像、文献目録、数式の挿入などたくさんの機能に対応しています! __appName__ で行える機能の詳細については、<0>__help_guides_link__</0> をご覧ください。", "latex_guides": "LaTeXガイド", "reset_password": "パスワードの再設定", "set_password": "パスワードの設定", "updating_site": "サイトの更新中", "bonus_please_recommend_us": "ボーナス- 当社を推薦してください", "admin": "管理", "subscribe": "定期購読", "update_billing_details": "支払い詳細の更新", "group_admin": "グループ管理", "all_templates": "テンプレート一覧", "your_settings": "設定", "maintenance": "メンテナンス", "to_many_login_requests_2_mins": "このアカウントはあまりに多くのログインリクエストを行っています。2分後に再度ログインしてください", "email_or_password_wrong_try_again": "メールアドレスまたはパスワードが正しくありません。再度お試しください", "rate_limit_hit_wait": "アクセス制限に達しました。しばらく時間を置いて再度お試しください", "problem_changing_email_address": "メールアドレスの変更に際して問題が発生しました。しばらく時間を置いて再度お試しください。問題が解消されない場合は、当社までお問い合わせください。", "single_version_easy_collab_blurb": "__appName__ があれば、共同編集者の最新状況、現在の作業内容を確認できます。 それぞれのドキュメントの1つのマスターバージョンに全員がアクセスできます。変更の衝突が起こることもなく、続きの仕事をするために同僚が最新の下書きを送信するのを待つ必要もありません。", "can_see_collabs_type_blurb": "複数の人が同時に1つの文書で仕事をする必要がある場合でも、問題ありません。エディターで同僚が入力している箇所を直接確認することができ、変更内容も直ちに画面に表示されます。", "work_directly_with_collabs": "共同編集者と直接作業する", "work_with_word_users": "Wordユーザーと作業する", "work_with_word_users_blurb": "__appName__ の始め方はとても簡単で、LaTeXを使用していない同僚を招待して、あなたのLaTeXドキュメントに協力してもらうことができます。初日から作業が捗り、時間の経過とともにLaTeXを少しずつ積み上げることができます。", "view_which_changes": "行われた変更を表示", "sl_included_history_of_changes_blurb": "__appName__ は変更履歴をすべて記録できるので、誰がいつ何を変更したかを正確に把握することができます。これによって、共同編集者によって行われた最新の進捗状況と作業内容をとても簡単に確認できます。", "can_revert_back_blurb": "共同作業時あるいはご自身でミスをしてしまうことがあります。以前のバージョンに復元する機能で簡単に、作業の紛失や間違った変更のリスクを取り除くことができます。", "start_using_sl_now": "__appName__ の利用を今すぐ開始", "over_x_templates_easy_getting_started": "当社のテンプレートギャラリーには __over__ 400 __templates__ が用意されています。論文や履歴書、あるいは他の文書を書いているときでも、とても簡単に利用を開始することができます。", "done": "完了", "change": "変更", "page_not_found": "ページが見つかりません", "please_see_help_for_more_info": "詳細についてはヘルプガイドをご覧ください", "this_project_will_appear_in_your_dropbox_folder_at": "このプロジェクトはあなたのDropboxフォルダに表示されます ", "member_of_group_subscription": "あなたは __admin_email__ が管理するグループ購読のメンバーです。購読内容の管理についてはこの人たちに問い合わせてください。\n", "about_henry_oswald": "ロンドンに住むソフトウェアエンジニアです。__appName__ のオリジナルプロトタイプを製作し、安定したスケーラブルなプラットフォームの構築を担っています。ヘンリーはテスト駆動開発を強く主張しており、__appName__ のコードが簡単に維持できるように努めています。", "about_james_allen": "理論物理学の博士号を取得し、LaTeXに情熱を捧げています。初めてのオンラインLaTeXエディターの1つであるScribTeXを作成し、__appName__ を可能にする技術の開発において重大な役割を担っています。", "two_strong_principles_behind_sl": "__appName__ 背景には2つの大きな原則が存在しています。", "want_to_improve_workflow_of_as_many_people_as_possible": "なるべく多くの人のワークフローを改善したいと考えています。", "detail_on_improve_peoples_workflow": "LaTeXは使い方が難しいことで名高く、共同作業を調整するのは難しいものです。このような問題に直面した人を助ける便利なソリューションを開発していることを当社は自負しており、なるべく多くの人が __appName__ を利用できるようにしたいと考えています。公正な価格に抑え、__appName__ の多くをオープンソースで発売することで、誰もが各自でホストできるようにしています。", "want_to_create_sustainable_lasting_legacy": "持続可能で長持ちする遺産を作り出したいと考えています。", "details_on_legacy": "__appName__ のような製品の開発とメンテナンスには多大な時間と労力が必要となります。そのため、現在および長期的に製品をサポートするビジネスモデルを見つけることが大切となります。__appName__ が外部資金に依存すること、ビジネスモデルの失敗によって消滅してしまうことは望んでいません。現在、利益を出して継続的に __appName__ の開発を実現しており、そして長期的にも行えると期待できることを喜んでお伝えします。", "get_in_touch": "お問い合わせ", "want_to_hear_from_you_email_us_at": "__appName__ を利用されている方からのご意見、当社の業務に興味のある人からのお問い合わせを喜んでお受けしております。次の連絡先からご連絡ください", "cant_find_email": "このメールアドレスは登録されていません。申し訳ありません。", "plans_amper_pricing": "プランと価格", "documentation": "ドキュメンテーション", "account": "アカウント", "subscription": "購読", "log_out": "ログアウト", "en": "英語", "pt": "ポルトガル語", "es": "スペイン語", "fr": "フランス語", "de": "ドイツ語", "it": "イタリア語", "da": "デンマーク語", "sv": "スェーデン語", "no": "ノルウェー語", "nl": "オランダ語", "pl": "ポーランド語", "ru": "ロシア語", "uk": "ウクライナ語", "ro": "ルーマニア語", "click_here_to_view_sl_in_lng": "こちらをクリックして <0>__lngName__</0> で __appName__ を使用", "language": "言語", "upload": "アップロード", "menu": "メニュー", "full_screen": "フルスクリーン", "logs_and_output_files": "ログと出力ファイル", "download_pdf": "PDFをダウンロード", "split_screen": "スプリットスクリーン", "clear_cached_files": "キャッシュファイルを削除", "go_to_code_location_in_pdf": "PDFのコードロケーションに進む", "please_compile_pdf_before_download": "PDFをダウンロードする前にプロジェクトをコンパイルして下さい", "remove_collaborator": "共同編集者の削除", "add_to_folders": "フォルダに追加", "download_zip_file": "ZIPファイルをダウンロード", "price": "価格", "close": "閉じる", "keybindings": "キー機能設定", "restricted": "制限されています", "start_x_day_trial": "__len__ 日間の無料トライアルを今日から始める!", "buy_now": "今すぐ購入!", "cs": "チェコ語", "view_all": "すべて表示", "terms": "規約", "privacy": "プライバシー", "contact": "お問い合わせ", "change_to_this_plan": "このプランに変更", "processing": "実行中", "sure_you_want_to_change_plan": "本当にプランを <0>__planName__</0> に変えますか?", "move_to_annual_billing": "年間支払いに移動", "annual_billing_enabled": "年間支払い許可", "move_to_annual_billing_now": "年間支払いに今すぐ移動", "change_to_annual_billing_and_save": "年間料金 <0>__percentage__</0> オフを獲得。今切り替えると、年間 <1>__yearlySaving__</1> 節約できます。", "missing_template_question": "テンプレートが見当たりませんか?", "tell_us_about_the_template": "テンプレートが見つからない場合は、テンプレートのコピー、テンプレートの __appName__ URLを送っていただくか、テンプレートの見つかる場所を教えてください。また、説明のテンプレートについての情報もお知らせください。", "email_us": "メールを送る", "this_project_is_public_read_only": "このプロジェクトは公開されており、URLを知っている人に表示されますが、編集はできません。", "tr": "トルコ語", "select_files": "ファイルを選択", "drag_files": "ファイルをドラッグ", "upload_failed_sorry": "アップロード失敗、申し訳ありません。 :(", "inserting_files": "ファイルの挿入中…", "password_reset_token_expired": "パスワード再設定トークンの期限が切れました。新しいパスワード再設定メールをリクエストして、そこに記載されたリンクにしたがってください。", "merge_project_with_github": "GitHubとプロジェクトを統合", "pull_github_changes_into_sharelatex": "GitHubの変更を __appName__ に引き込む", "push_sharelatex_changes_to_github": "__appName__ の変更をGitHubに押し込む", "features": "機能", "commit": "コミット", "commiting": "コミット中", "importing_and_merging_changes_in_github": "GitHubの変更をインポートおよび統合中", "upgrade_for_faster_compiles": "アップグレードしてすばやい編集、タイムアウト上限の引き上げ", "free_accounts_have_timeout_upgrade_to_increase": "無料アカウントは1分でタイムアウトします。アップグレードしてタイムアウトの上限を引き上げる。", "learn_how_to_make_documents_compile_quickly": "ドキュメントをすばやく編集する方法を学ぶ", "zh-CN": "中国語", "cn": "中国語(簡体字)", "sync_to_github": "GitHubと同期", "sync_to_dropbox_and_github": "DropboxとGitHubと同期", "project_too_large": "プロジェクトが大きすぎます", "project_too_large_please_reduce": "このプロジェクトには編集可能なテキストが多すぎます。テキストを減らしてください。最大ファイルは次の通りです:", "please_ask_the_project_owner_to_link_to_github": "このプロジェクトをGitHubリポジトリとリンクするにはプロジェクト管理者に問い合わせてください", "go_to_pdf_location_in_code": "コードのPDFロケーションに進む", "ko": "韓国語", "ja": "日本語", "about_brian_gough": "ソフトウェア開発者で、以前はフェルミ国立加速器研究所およびロスアラモス国立研究所の理論高エネルギー物理学研究者でした。長年に渡り、TeXおよびLaTeXの商業的利用に関する無料ソフトウェアマニュアルを配布しており、GNU Scientific Libraryのメンテナーを務めていました。", "first_few_days_free": "初回__trialLen__ 日間無料", "every": "毎", "credit_card": "クレジットカード", "credit_card_number": "クレジットカード番号", "invalid": "不正な", "expiry": "有効期限", "january": "1月", "february": "2月", "march": "3月", "april": "4月", "may": "5月", "june": "6月", "july": "7月", "august": "8月", "september": "9月", "october": "10月", "november": "11月", "december": "12月", "zip_post_code": "郵便番号", "city": "市町村", "address": "住所", "coupon_code": "クーポンコード", "country": "国", "billing_address": "請求先住所", "upgrade_now": "今すぐアップグレード", "state": "状態", "vat_number": "VAT番号", "you_have_joined": "__groupName__ に参加しました", "claim_premium_account": "__groupName__ のプレミアムアカウントを獲得しました。", "you_are_invited_to_group": "__groupName__ への参加を招待されています。", "you_can_claim_premium_account": "メール認証によって、__groupName__ のプレミアムアカウントを獲得しました", "not_now": "今はまだありません", "verify_email_join_group": "メールを認証してグループに参加", "check_email_to_complete_group": "メールを確認して、グループへの参加を完了してください", "verify_email_address": "メールアドレスの認証", "group_provides_you_with_premium_account": "__groupName__ によってプレミアムアカウントが付与されました。メールアドレスを認証して、アカウントをアップグレードしてください。", "check_email_to_complete_the_upgrade": "メールを確認して、アップグレードを完了してください", "email_link_expired": "メールのリンクの有効期限が切れています。新しいリンクをリクエストしてください。", "services": "サービス", "about_shane_kilkelly": "エディンバラ在住のソフトウェア開発者です。シェーンは、関数型プログラミングとテスト駆動開発を強く支持しており、高クオリティのソフトウェア構築に大きな自信を持っています。", "this_is_your_template": "これはあなたのプロジェクトのテンプレートです", "links": "リンク", "account_settings": "アカウントの設定", "search_projects": "プロジェクトの検索", "clone_project": "プロジェクトの複製", "delete_project": "プロジェクトの削除", "download_zip": "ZIPをダウンロード", "new_project": "新規プロジェクト", "blank_project": "空のプロジェクト", "example_project": "プロジェクト例", "from_template": "テンプレートを使う", "cv_or_resume": "履歴書", "cover_letter": "カバーレター", "journal_article": "雑誌論文", "presentation": "プレゼンテーション", "thesis": "学位論文", "bibliographies": "参考文献", "terms_of_service": "利用規約", "privacy_policy": "プライバシーポリシー", "plans_and_pricing": "プランと料金", "university_licences": "大学用ライセンス", "security": "セキュリティ", "contact_us": "お問い合わせ", "thanks": "ありがとうございます", "blog": "ブログ", "latex_editor": "LaTeXエディター", "get_free_stuff": "無料プレゼントを獲得", "chat": "チャット", "your_message": "メッセージ", "loading": "読み込み中", "connecting": "接続中", "recompile": "リコンパイル", "download": "ダウンロード", "email": "電子メール", "owner": "管理者", "read_and_write": "読み書き", "read_only": "読み込み専用", "publish": "公開", "view_in_template_gallery": "テンプレートギャラリーで表示", "unpublish": "未公開", "hotkeys": "ショートカットキー", "saving": "保存中", "cancel": "取消", "project_name": "プロジェクト名", "root_document": "ルートドキュメント", "spell_check": "スペルチェック", "compiler": "コンパイラ", "private": "非公開", "public": "公開", "delete_forever": "完全に削除", "support_and_feedback": "サポートとフィードバック", "help": "ヘルプ", "latex_templates": "LaTeXテンプレート", "info": "情報", "latex_help_guide": "LaTeXヘルプガイド", "choose_your_plan": "プランの選択", "indvidual_plans": "それぞれのプラン", "free_forever": "永久無料", "low_priority_compile": "優先度の低いコンパイル", "unlimited_projects": "プロジェクト数無制限", "unlimited_compiles": "コンパイル数無制限", "full_history_of_changes": "すべての変更履歴", "highest_priority_compiling": "最優先のコンパイル", "dropbox_sync": "Dropbox同期", "beta": "ベータ", "sign_up_now": "今すぐサインアップ", "annual": "年間", "half_price_student": "学生向け半額プラン", "about_us": "当社について", "loading_recent_github_commits": "最新コミットを読み込み中", "no_new_commits_in_github": "最終統合からGitHubに新しいコミットはありません。", "dropbox_sync_description": "__appName__ プロジェクトをDropboxと同期しましょう。__appName__ の変更が自動的にDropboxに送信されます。その逆も同じです。", "github_sync_description": "GitHub Syncがあれば、__appName__ プロジェクトとGitHubリポジトリを接続することができます。__appName__ から新しいコミットを作成して、オフラインあるいはGitHubで作成したコミットと統合できます。", "github_import_description": "GitHub Syncがあれば、GitHubリポジトリを__appName__ にインポートすることができます。__appName__ から新しいコミットを作成して、オフラインあるいはGitHubで作成したコミットと統合できます。", "link_to_github_description": "プロジェクトを同期するには __appName__ があなたのGitHubアカウントにアクセスするのを許可する必要があります。", "unlink": "リンク解除", "unlink_github_warning": "GitHubと同期したプロジェクトは接続を断たれ、GitHubと同期されなくなります。本当にGitHubアカウントの接続を解除しますか?", "github_account_successfully_linked": "アカウントは接続されました!", "github_successfully_linked_description": "ありがとうございます。GitHubアカウントと __appName__ のリンクが完了しました。これからは __appName__ プロジェクトをGitHubにエクスポート、あるいはGitHubリポジトリからプロジェクトのインポートをすることができます。", "import_from_github": "GitHubからインポート", "github_sync_error": "申し訳ありません。GitHubサービスとの接続に問題が発生しました。しばらく時間を置いて再度お試しください。", "loading_github_repositories": "あなたのGitHubリポジトリを読み込み中", "select_github_repository": "__appName__ にインポートするGitHubリポジトリを選択。", "import_to_sharelatex": "__appName__ にインポート", "importing": "インポート中", "github_sync": "GitHub同期", "checking_project_github_status": "GitHubのプロジェクトステータスを確認中", "account_not_linked_to_github": "あなたのアカウントはGitHubに接続されていません", "project_not_linked_to_github": "このプロジェクトはGitHubリポジトリと接続されていません。GitHubでリポジトリを作成できます:", "create_project_in_github": "GitHubリポジトリの作成", "project_synced_with_git_repo_at": "このプロジェクトはGitHubリポジトリと同期しています", "recent_commits_in_github": "GitHubの最新コミット", "sync_project_to_github": "プロジェクトをGitHubと同期", "sync_project_to_github_explanation": "__appName__ で行った変更はすべてGitHubの更新と関連付けられ、統合されます。", "github_merge_failed": "__appName__ とGitHubの変更を自動的に統合できませんでした。GIT内で <0>__sharelatex_branch__</0> ブランチと <1>__master_branch__</1> ブランチを手動で統合してください。手動で統合したあとに、下をクリックして続行してください。", "continue_github_merge": "手動で統合。続行", "export_project_to_github": "プロジェクトをGitHubにエクスポート", "github_validation_check": "リポジトリ名が有効か、リポジトリを作成する権限があるか確認してください。", "repository_name": "リポジトリ名", "optional": "オプショナル", "github_public_description": "このリポジトリは全員が閲覧できます。コミットできる人を選択します。", "github_commit_message_placeholder": "__appName__ で行われた変更のコミットメッセージ…", "merge": "統合", "merging": "統合中", "github_account_is_linked": "あなたのGitHubアカウントが接続されました。", "unlink_github": "GitHubアカウントの接続を解除", "link_to_github": "あなたのGitHubアカウントに接続", "github_integration": "GitHub連携", "github_is_premium": "GitHub統合はプレミアム機能です", "thank_you": "ありがとうございます" }
overleaf/web/locales/ja.json/0
{ "file_path": "overleaf/web/locales/ja.json", "repo_id": "overleaf", "token_count": 25256 }
555
/* eslint-disable no-unused-vars */ const Helpers = require('./lib/helpers') exports.tags = ['server-ce', 'server-pro', 'saas'] const indexes = [ { key: { doc_id: 1, v: 1, }, name: 'doc_id_1_v_1', }, { key: { project_id: 1, 'meta.end_ts': 1, }, name: 'project_id_1_meta.end_ts_1', }, { key: { doc_id: 1, project_id: 1, }, name: 'doc_id_1_project_id_1', }, { key: { expiresAt: 1, }, name: 'expiresAt_1', expireAfterSeconds: 0, }, { key: { last_checked: 1, }, name: 'last_checked_1', }, ] exports.migrate = async client => { const { db } = client await Helpers.addIndexesToCollection(db.docHistory, indexes) } exports.rollback = async client => { const { db } = client try { await Helpers.dropIndexesFromCollection(db.docHistory, indexes) } catch (err) { console.error('Something went wrong rolling back the migrations', err) } }
overleaf/web/migrations/20190912145005_create_docHistory_indexes.js/0
{ "file_path": "overleaf/web/migrations/20190912145005_create_docHistory_indexes.js", "repo_id": "overleaf", "token_count": 457 }
556
/* eslint-disable no-unused-vars */ const Helpers = require('./lib/helpers') exports.tags = ['saas'] const indexes = [ { key: { project_id: 1, }, name: 'project_id_1', }, { key: { expiresAt: 1, }, name: 'expiresAt_1', expireAfterSeconds: 0, }, ] exports.migrate = async client => { const { db } = client await Helpers.addIndexesToCollection(db.projectHistorySyncState, indexes) } exports.rollback = async client => { const { db } = client try { await Helpers.dropIndexesFromCollection(db.projectHistorySyncState, indexes) } catch (err) { console.error('Something went wrong rolling back the migrations', err) } }
overleaf/web/migrations/20190912145021_create_projectHistorySyncState_indexes.js/0
{ "file_path": "overleaf/web/migrations/20190912145021_create_projectHistorySyncState_indexes.js", "repo_id": "overleaf", "token_count": 267 }
557
/* eslint-disable no-unused-vars */ const Helpers = require('./lib/helpers') exports.tags = ['server-ce', 'server-pro', 'saas'] const indexes = { docSnapshots: [{ key: { project_id: 1, ts: 1 }, name: 'project_id_1_ts_1' }], deletedProjects: [ { key: { 'deleterData.deletedProjectOwnerId': 1 }, name: 'deleterdata_deletedProjectOwnerId_1', }, ], docs: [{ key: { project_id: 1, inS3: 1 }, name: 'project_id_1_inS3_1' }], } exports.migrate = async client => { const { db } = client await Promise.all( Object.keys(indexes).map(key => Helpers.addIndexesToCollection(db[key], indexes[key]) ) ) } exports.rollback = async client => { const { db } = client await Promise.all( Object.keys(indexes).map(key => Helpers.dropIndexesFromCollection(db[key], indexes[key]) ) ) }
overleaf/web/migrations/20200120163346_atlas_recommended_indexes.js/0
{ "file_path": "overleaf/web/migrations/20200120163346_atlas_recommended_indexes.js", "repo_id": "overleaf", "token_count": 348 }
558
const runScript = require('../scripts/back_fill_dummy_doc_meta.js') exports.tags = ['server-ce', 'server-pro', 'saas'] exports.migrate = async client => { const { db } = client const [firstProject] = await db.projects .find() .sort({ _id: 1 }) .limit(1) .toArray() if (!firstProject) { return } const options = { firstProjectId: firstProject._id, performCleanup: true, letUserDoubleCheckInputsFor: 10, } await runScript(options) } exports.rollback = async client => {}
overleaf/web/migrations/20210728115327_ce_sp_backfill_dummy_doc_meta.js/0
{ "file_path": "overleaf/web/migrations/20210728115327_ce_sp_backfill_dummy_doc_meta.js", "repo_id": "overleaf", "token_count": 196 }
559
{ "name": "web-overleaf", "version": "0.1.4", "description": "The HTTP front end for ShareLaTeX", "license": "AGPL-3.0-only", "private": true, "repository": { "type": "git", "url": "https://github.com/sharelatex/web-sharelatex.git" }, "directories": { "public": "./public" }, "scripts": { "test:acceptance:run_dir": "mocha --recursive --timeout 25000 --exit --grep=$MOCHA_GREP --require test/acceptance/bootstrap.js", "test:acceptance:app": "npm run test:acceptance:run_dir -- test/acceptance/src", "test:unit:run_dir": "mocha --recursive --timeout 25000 --exit --grep=$MOCHA_GREP --require test/unit/bootstrap.js", "test:unit:all": "npm run test:unit:run_dir -- test/unit/src modules/*/test/unit/src", "test:unit:all:silent": "npm run test:unit:all -- --reporter dot", "test:unit:app": "npm run test:unit:run_dir -- test/unit/src", "test:unit:app:parallel": "parallel --plain --keep-order --halt now,fail=1 npm run test:unit:run_dir -- {} ::: test/unit/src/*", "test:frontend": "NODE_ENV=test TZ=GMT mocha --recursive --timeout 5000 --exit --grep=$MOCHA_GREP --require test/frontend/bootstrap.js test/frontend modules/*/test/frontend", "test:frontend:coverage": "c8 --all --include 'frontend/js' --include 'modules/*/frontend/js' --exclude 'frontend/js/vendor' --reporter=lcov --reporter=text-summary npm run test:frontend", "test:karma": "karma start", "test:karma:single": "karma start --no-auto-watch --single-run", "start": "node $NODE_APP_OPTIONS app.js", "nodemon": "nodemon $NODE_APP_OPTIONS --config nodemon.json", "webpack": "webpack-dev-server --config webpack.config.dev.js", "webpack:production": "webpack --config webpack.config.prod.js", "format": "prettier --list-different $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'", "format:styles": "prettier --list-different $PWD/'**/*.less'", "format:styles:fix": "prettier --write $PWD/'**/*.less'", "lint": "eslint --max-warnings 0 --format unix .", "lint:fix": "eslint --fix .", "extract-translations": "i18next-scanner", "migrations": "east", "storybook": "start-storybook -p 6006 -s ./public" }, "browserslist": [ "last 1 year", "ie 11", "firefox esr" ], "dependencies": { "@babel/cli": "^7.14.5", "@babel/core": "^7.14.5", "@babel/preset-env": "^7.14.5", "@babel/preset-react": "^7.14.5", "@overleaf/metrics": "^3.5.1", "@overleaf/o-error": "^3.3.1", "@overleaf/object-persistor": "https://github.com/overleaf/object-persistor/archive/8fbc9ed03206bfb54368578d22b7ac4f285baa25.tar.gz", "@overleaf/redis-wrapper": "^2.0.0", "@overleaf/settings": "^2.1.1", "@pollyjs/adapter-node-http": "^4.2.1", "@pollyjs/core": "^4.2.1", "@pollyjs/persister-fs": "^4.2.1", "@reach/tabs": "^0.15.0", "@sentry/browser": "^6.3.5", "@uppy/core": "^1.15.0", "@uppy/dashboard": "^1.11.0", "@uppy/react": "^1.11.0", "@uppy/xhr-upload": "^1.6.8", "abort-controller": "^3.0.0", "accepts": "^1.3.7", "ace-builds": "https://github.com/overleaf/ace-builds/archive/v1.4.12-69aace50e6796d42116f8f96e19d2468d8a88af9.tar.gz", "algoliasearch": "^3.35.1", "angular": "~1.8.0", "angular-sanitize": "~1.8.0", "archiver": "4.0.1", "async": "0.6.2", "backbone": "^1.3.3", "basic-auth-connect": "^1.0.0", "bcrypt": "^5.0.0", "body-parser": "^1.19.0", "bowser": "^2.11.0", "bufferedstream": "1.6.0", "bull": "^3.18.0", "bunyan": "^1.8.15", "cache-flow": "^1.7.4", "celebrate": "^10.0.1", "classnames": "^2.2.6", "codemirror": "^5.33.0", "connect-redis": "^3.1.0", "contentful": "^6.1.1", "cookie": "^0.2.3", "cookie-parser": "1.3.5", "core-js": "^3.6.2", "crypto-js": "^3.1.9-1", "csurf": "^1.11.0", "d3": "^3.5.16", "dateformat": "1.0.4-1.2.3", "daterangepicker": "https://github.com/40thieves/daterangepicker/archive/e496d2d44ca53e208c930e4cb4bcf29bcefa4550.tar.gz", "downshift": "^6.1.0", "east": "^2.0.2", "express": "4.17.1", "express-bearer-token": "^2.4.0", "express-http-proxy": "^1.6.0", "express-session": "^1.17.1", "fs-extra": "^4.0.2", "fuse.js": "^3.0.0", "globby": "^5.0.0", "handlebars": "^4.7.6", "helmet": "^3.22.0", "http-proxy": "^1.18.1", "i18next": "^19.6.3", "i18next-fs-backend": "^1.0.7", "i18next-http-middleware": "^3.0.2", "isomorphic-unfetch": "^3.0.0", "jquery": "^2.2.4", "json2csv": "^4.3.3", "jsonwebtoken": "^8.5.1", "ldapjs": "^0.7.1", "lodash": "^4.17.19", "logger-sharelatex": "^2.2.0", "lru-cache": "^6.0.0", "mailchimp-api-v3": "^1.12.0", "marked": "^0.3.5", "match-sorter": "^6.2.0", "mathjax": "^2.7.9", "method-override": "^2.3.3", "minimist": "1.2.5", "mmmagic": "^0.5.3", "moment": "^2.24.0", "mongodb": "^3.6.0", "mongoose": "^5.10.7", "multer": "https://github.com/overleaf/multer/archive/7a2928d7ea2da02dd92888ea1c9ba5704e07aeeb.tar.gz", "nocache": "^2.1.0", "nodemailer": "2.1.0", "nodemailer-mandrill-transport": "^1.2.0", "nodemailer-ses-transport": "^1.5.1", "nvd3": "^1.8.6", "oauth2-server": "^3.0.1", "otplib": "^12.0.1", "p-limit": "^2.3.0", "parse-data-url": "^2.0.0", "passport": "^0.4.1", "passport-google-oauth20": "^2.0.0", "passport-ldapauth": "^2.1.4", "passport-local": "^1.0.0", "passport-oauth2": "^1.5.0", "passport-orcid": "0.0.4", "passport-saml": "https://github.com/overleaf/passport-saml/releases/download/v3.0.0-overleaf/passport-saml-3.0.0-overleaf.tar.gz", "passport-twitter": "^1.0.4", "pdfjs-dist": "^2.2.228", "prop-types": "^15.7.2", "pug": "^3.0.1", "pug-runtime": "^3.0.1", "qrcode": "^1.4.4", "react": "^17.0.2", "react-bootstrap": "^0.33.1", "react-dnd": "^11.1.3", "react-dnd-html5-backend": "^11.1.3", "react-dom": "^17.0.2", "react-error-boundary": "^2.3.1", "react-i18next": "^11.7.1", "react-linkify": "^1.0.0-alpha", "react2angular": "^4.0.6", "react2angular-shared-context": "^1.1.0", "recurly": "^4.0.0", "referer-parser": "0.0.3", "request": "^2.88.2", "request-promise-native": "^1.0.8", "requestretry": "^1.13.0", "rimraf": "2.2.6", "rolling-rate-limiter": "^0.2.10", "sanitize-html": "^1.27.1", "scroll-into-view-if-needed": "^2.2.25", "underscore": "^1.13.1", "url-parse": "^1.4.7", "utf-8-validate": "^5.0.2", "uuid": "^3.0.1", "valid-data-url": "^2.0.0", "valid-url": "^1.0.9", "xml-crypto": "^2.1.2", "xml2js": "^0.4.22", "xregexp": "^4.3.0", "yauzl": "^2.10.0" }, "devDependencies": { "@babel/register": "^7.14.5", "@storybook/addon-a11y": "^6.2.9", "@storybook/addon-essentials": "^6.2.9", "@storybook/react": "^6.2.9", "@testing-library/dom": "^7.31.2", "@testing-library/react": "^11.2.7", "@testing-library/react-hooks": "^7.0.0", "acorn": "^7.1.1", "acorn-walk": "^7.1.1", "angular-mocks": "~1.8.0", "autoprefixer": "^9.7.6", "babel-loader": "^8.2.2", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-macros": "^3.1.0", "c8": "^7.2.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-exclude": "^2.0.3", "chaid": "^1.0.2", "cheerio": "^1.0.0-rc.3", "copy-webpack-plugin": "^5.1.1", "css-loader": "^3.5.2", "es6-promise": "^4.2.8", "eslint": "^7.21.0", "eslint-config-prettier": "^8.1.0", "eslint-config-standard": "^16.0.2", "eslint-config-standard-jsx": "^10.0.0", "eslint-config-standard-react": "^11.0.1", "eslint-plugin-chai-expect": "^2.2.0", "eslint-plugin-chai-friendly": "^0.6.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-mocha": "^8.0.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-standard": "^5.0.0", "expose-loader": "^0.7.5", "fetch-mock": "^9.10.2", "file-loader": "^5.0.2", "glob": "^7.1.6", "handlebars-loader": "^1.7.1", "i18next-scanner": "^3.0.0", "jsdom": "^16.6.0", "jsdom-global": "^3.0.2", "karma": "^5.0.2", "karma-chai-sinon": "^0.1.5", "karma-chrome-launcher": "^3.1.0", "karma-mocha": "^2.0.0", "karma-mocha-reporter": "^2.2.5", "karma-requirejs": "^1.1.0", "karma-webpack": "^4.0.2", "less": "^3.11.1", "less-loader": "^6.0.0", "less-plugin-autoprefix": "^2.0.0", "mini-css-extract-plugin": "^0.8.0", "mkdirp": "0.5.1", "mocha": "^8.3.2", "mock-fs": "^4.11.0", "node-fetch": "^2.6.1", "nodemon": "^2.0.6", "optimize-css-assets-webpack-plugin": "^5.0.3", "pirates": "^4.0.1", "postcss-loader": "^3.0.0", "prettier": "^2.2.1", "requirejs": "^2.3.6", "samlp": "^3.4.1", "sandboxed-module": "^2.0.4", "sinon": "^7.5.0", "sinon-chai": "^3.5.0", "sinon-mongoose": "^2.3.0", "socket.io-mock": "^1.3.1", "terser-webpack-plugin": "^2.3.6", "timekeeper": "^2.2.0", "to-string-loader": "^1.1.6", "val-loader": "^1.1.1", "webpack": "^4.44.2", "webpack-cli": "^3.3.11", "webpack-dev-server": "^3.11.0", "webpack-manifest-plugin": "^2.2.0", "webpack-merge": "^4.2.2" } }
overleaf/web/package.json/0
{ "file_path": "overleaf/web/package.json", "repo_id": "overleaf", "token_count": 5135 }
560
const { batchedUpdate } = require('./helpers/batchedUpdate') const { promiseMapWithLimit, promisify } = require('../app/src/util/promises') const { db } = require('../app/src/infrastructure/mongodb') const sleep = promisify(setTimeout) const _ = require('lodash') async function main(options) { if (!options) { options = {} } _.defaults(options, { writeConcurrency: parseInt(process.env.WRITE_CONCURRENCY, 10) || 10, performCleanup: process.argv.pop() === '--perform-cleanup', letUserDoubleCheckInputsFor: parseInt( process.env.LET_USER_DOUBLE_CHECK_INPUTS_FOR || 10 * 1000, 10 ), }) await letUserDoubleCheckInputs(options) await batchedUpdate( 'projects', // array is not empty ~ array has one item { 'deletedDocs.0': { $exists: true } }, async (_collection, projects) => { await processBatch(_collection, projects, options) }, { _id: 1, deletedDocs: 1 } ) } async function processBatch(_, projects, options) { await promiseMapWithLimit( options.writeConcurrency, projects, async project => { await processProject(project, options) } ) } async function processProject(project, options) { for (const doc of project.deletedDocs) { await backFillDoc(doc) } if (options.performCleanup) { await cleanupProject(project) } } async function backFillDoc(doc) { const { name, deletedAt } = doc await db.docs.updateOne({ _id: doc._id }, { $set: { name, deletedAt } }) } async function cleanupProject(project) { await db.projects.updateOne( { _id: project._id }, { $set: { deletedDocs: [] } } ) } async function letUserDoubleCheckInputs(options) { if (options.performCleanup) { console.error('BACK FILLING AND PERFORMING CLEANUP') } else { console.error( 'BACK FILLING ONLY - You will need to rerun with --perform-cleanup' ) } console.error( 'Waiting for you to double check inputs for', options.letUserDoubleCheckInputsFor, 'ms' ) await sleep(options.letUserDoubleCheckInputsFor) } module.exports = main if (require.main === module) { main() .then(() => { process.exit(0) }) .catch(error => { console.error({ error }) process.exit(1) }) }
overleaf/web/scripts/back_fill_doc_name_for_deleted_docs.js/0
{ "file_path": "overleaf/web/scripts/back_fill_doc_name_for_deleted_docs.js", "repo_id": "overleaf", "token_count": 845 }
561
/* subscription.freeTrialExpiresAt * Example script for a migration: * * This script demonstrates how to write a script that is runnable either via * the CLI, or via a migration. The related migration is `script_example` * in the migrations directory. */ const { User } = require('../../app/src/models/User') // const somePackage = require('some-package') const runScript = async () => { const user = await User.findOne({}, { first_name: 1 }).exec() const name = user ? user.first_name : 'World' console.log(`Hello ${name}!`) } if (!module.parent) { // we are in the root module, which means that we're running as a script runScript() .then(() => process.exit()) .catch(err => { console.error(err) process.exit(1) }) } module.exports = runScript
overleaf/web/scripts/example/script_for_migration.js/0
{ "file_path": "overleaf/web/scripts/example/script_for_migration.js", "repo_id": "overleaf", "token_count": 257 }
562
require 'rubygems' require 'recurly' require 'json' if ENV['RECURLY_SUBDOMAIN'] Recurly.subdomain = ENV['RECURLY_SUBDOMAIN'] else print "Defaulting to sharelatex-sandbox. Set RECURLY_SUBDOMAIN environment variable to override\n" Recurly.subdomain = "sharelatex-sandbox" end if ENV['RECURLY_API_KEY'] Recurly.api_key = ENV['RECURLY_API_KEY'] else print "Please set RECURLY_API_KEY environment variable\n" exit 1 end file = File.read('../../app/templates/plans/groups.json') groups = JSON.parse(file) # data format: groups[usage][plan_code][currency][size] = price PLANS = {} groups.each do |usage, data| data.each do |plan_code, data| data.each do |currency, data| data.each do |size, price| full_plan_code = "group_#{plan_code}_#{size}_#{usage}" plan = PLANS[full_plan_code] ||= { plan_code: full_plan_code, name: "Overleaf #{plan_code.capitalize} - Group Account (#{size} licenses) - #{usage.capitalize}", unit_amount_in_cents: {}, plan_interval_length: 12, plan_interval_unit: 'months', tax_code: 'digital' } plan[:unit_amount_in_cents][currency] = price * 100 end end end end PLANS.each do |plan_code, plan| print "Syncing #{plan_code}...\n" print "#{plan}\n" begin recurly_plan = Recurly::Plan.find(plan_code) rescue Recurly::Resource::NotFound => e recurly_plan = nil end if recurly_plan.nil? print "No plan found, creating...\n" Recurly::Plan.create(plan) else print "Existing plan found, updating...\n" plan.each do |key, value| recurly_plan[key] = value recurly_plan.save end end print "Done!\n" end
overleaf/web/scripts/recurly/sync_recurly.rb/0
{ "file_path": "overleaf/web/scripts/recurly/sync_recurly.rb", "repo_id": "overleaf", "token_count": 679 }
563
const { promises: fs } = require('fs') const { promisify } = require('util') const oneSky = require('@brainly/onesky-utils') const { withAuth } = require('./config') const sleep = promisify(setTimeout) async function uploadLocales() { // Docs: https://github.com/onesky/api-documentation-platform/blob/master/resources/file.md#upload---upload-a-file const blob = await oneSky.postFile( withAuth({ fileName: 'en-US.json', language: 'en-GB', format: 'HIERARCHICAL_JSON', content: await fs.readFile(`${__dirname}/../../locales/en.json`), keepStrings: false, // deprecate locales that no longer exist in en.json }) ) return JSON.parse(blob).data.import.id } async function getImportTask(importId) { // Docs: https://github.com/onesky/api-documentation-platform/blob/master/resources/import_task.md const blob = await oneSky.getImportTask(withAuth({ importId })) return JSON.parse(blob).data } async function pollUploadStatus(importId) { let task while ((task = await getImportTask(importId)).status === 'in-progress') { console.log('onesky is processing the import ...') await sleep(5000) } if (task.status === 'failed') { console.error({ task }) throw new Error('upload failed') } } async function main() { const importId = await uploadLocales() await pollUploadStatus(importId) } main().catch(error => { console.error({ error }) process.exit(1) })
overleaf/web/scripts/translations/upload.js/0
{ "file_path": "overleaf/web/scripts/translations/upload.js", "repo_id": "overleaf", "token_count": 504 }
564
/* eslint-disable camelcase, max-len, no-unused-vars, node/no-deprecated-api, */ // 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 * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const { expect } = require('chai') const request = require('./helpers/request') const Settings = require('@overleaf/settings') const auth = new Buffer('sharelatex:password').toString('base64') const authed_request = request.defaults({ headers: { Authorization: `Basic ${auth}`, }, }) describe('ApiClsiTests', function () { describe('compile', function () { beforeEach(function (done) { this.compileSpec = { compile: { options: { compiler: 'pdflatex', timeout: 60, }, rootResourcePath: 'main.tex', resources: [ { path: 'main/tex', content: '\\documentclass{article}\n\\begin{document}\nHello World\n\\end{document}', }, { path: 'image.png', url: 'www.example.com/image.png', modified: 123456789, }, ], }, } return done() }) describe('valid request', function () { it('returns success and a list of output files', function (done) { return authed_request.post( { uri: '/api/clsi/compile/abcd', json: this.compileSpec, }, (error, response, body) => { if (error != null) { throw error } expect(response.statusCode).to.equal(200) expect(response.body).to.deep.equal({ status: 'success', outputFiles: [ { path: 'project.pdf', url: '/project/abcd/build/1234/output/project.pdf', type: 'pdf', build: 1234, }, { path: 'project.log', url: '/project/abcd/build/1234/output/project.log', type: 'log', build: 1234, }, ], }) return done() } ) }) }) describe('unauthorized', function () { it('returns 401', function (done) { return request.post( { uri: '/api/clsi/compile/abcd', json: this.compileSpec, }, (error, response, body) => { if (error != null) { throw error } expect(response.statusCode).to.equal(401) expect(response.body).to.equal('Unauthorized') return done() } ) }) }) }) describe('get output', function () { describe('valid file', function () { it('returns the file', function (done) { return authed_request.get( '/api/clsi/compile/abcd/build/1234/output/project.pdf', (error, response, body) => { if (error != null) { throw error } expect(response.statusCode).to.equal(200) expect(response.body).to.equal('mock-pdf') return done() } ) }) }) describe('invalid file', function () { it('returns 404', function (done) { return authed_request.get( '/api/clsi/compile/abcd/build/1234/output/project.aux', (error, response, body) => { if (error != null) { throw error } expect(response.statusCode).to.equal(404) expect(response.body).to.not.equal('mock-pdf') return done() } ) }) }) describe('unauthorized', function () { it('returns 401', function (done) { return request.get( '/api/clsi/compile/abcd/build/1234/output/project.pdf', (error, response, body) => { if (error != null) { throw error } expect(response.statusCode).to.equal(401) expect(response.body).to.not.equal('mock-pdf') return done() } ) }) }) }) })
overleaf/web/test/acceptance/src/ApiClsiTests.js/0
{ "file_path": "overleaf/web/test/acceptance/src/ApiClsiTests.js", "repo_id": "overleaf", "token_count": 2289 }
565
const { expect } = require('chai') const _ = require('underscore') const mkdirp = require('mkdirp') const { promisify } = require('util') const Settings = require('@overleaf/settings') const User = require('./helpers/User').promises const express = require('express') const LinkedUrlProxy = express() LinkedUrlProxy.get('/', (req, res, next) => { if (req.query.url === 'http://example.com/foo') { return res.send('foo foo foo') } else if (req.query.url === 'http://example.com/bar') { return res.send('bar bar bar') } else { return res.sendStatus(404) } }) describe('LinkedFiles', function () { let projectOne, projectOneId, projectOneRootFolderId let projectTwo, projectTwoId, projectTwoRootFolderId const sourceDocName = 'test.txt' let owner before(function (done) { LinkedUrlProxy.listen(6543, done) }) beforeEach(async function () { owner = new User() await owner.login() await promisify(mkdirp)(Settings.path.dumpFolder) }) describe('creating a project linked file', function () { beforeEach(async function () { projectOneId = await owner.createProject('plf-test-one', { template: 'blank', }) projectOne = await owner.getProject(projectOneId) projectOneRootFolderId = projectOne.rootFolder[0]._id.toString() projectTwoId = await owner.createProject('plf-test-two', { template: 'blank', }) projectTwo = await owner.getProject(projectTwoId) projectTwoRootFolderId = projectTwo.rootFolder[0]._id.toString() await owner.createDocInProject( projectTwoId, projectTwoRootFolderId, sourceDocName ) await owner.createDocInProject( projectTwoId, projectTwoRootFolderId, 'some-harmless-doc.txt' ) }) it('should produce a list of the users projects and their entities', async function () { let { body } = await owner.doRequest('get', { url: '/user/projects', json: true, }) expect(body).to.deep.equal({ projects: [ { _id: projectOneId, name: 'plf-test-one', accessLevel: 'owner', }, { _id: projectTwoId, name: 'plf-test-two', accessLevel: 'owner', }, ], }) ;({ body } = await owner.doRequest('get', { url: `/project/${projectTwoId}/entities`, json: true, })) expect(body).to.deep.equal({ project_id: projectTwoId, entities: [ { path: '/main.tex', type: 'doc' }, { path: '/some-harmless-doc.txt', type: 'doc' }, { path: '/test.txt', type: 'doc' }, ], }) }) it('should import a file and refresh it if there is no v1 id', async function () { // import the file from the source project let { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { name: 'test-link.txt', parent_folder_id: projectOneRootFolderId, provider: 'project_file', data: { source_project_id: projectTwoId, source_entity_path: `/${sourceDocName}`, }, }, }) expect(response.statusCode).to.equal(200) const existingFileId = body.new_file_id expect(existingFileId).to.exist let updatedProjectOne = await owner.getProject(projectOneId) let firstFile = updatedProjectOne.rootFolder[0].fileRefs[0] expect(firstFile._id.toString()).to.equal(existingFileId.toString()) expect(firstFile.linkedFileData).to.deep.equal({ provider: 'project_file', source_project_id: projectTwoId, source_entity_path: `/${sourceDocName}`, }) expect(firstFile.name).to.equal('test-link.txt') // refresh the file ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file/${existingFileId}/refresh`, json: true, })) expect(response.statusCode).to.equal(200) const newFileId = body.new_file_id expect(newFileId).to.exist expect(newFileId).to.not.equal(existingFileId) updatedProjectOne = await owner.getProject(projectOneId) firstFile = updatedProjectOne.rootFolder[0].fileRefs[0] expect(firstFile._id.toString()).to.equal(newFileId.toString()) expect(firstFile.name).to.equal('test-link.txt') // should not work if there is a v1 id ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { name: 'test-link-should-not-work.txt', parent_folder_id: projectOneRootFolderId, provider: 'project_file', data: { v1_source_doc_id: 1234, source_entity_path: `/${sourceDocName}`, }, }, })) expect(response.statusCode).to.equal(403) expect(body).to.equal('You do not have access to this project') }) }) describe('with a linked project_file from a v1 project that has not been imported', function () { beforeEach(async function () { projectOneId = await owner.createProject('plf-v1-test-one', { template: 'blank', }) projectOne = await owner.getProject(projectOneId) projectOneRootFolderId = projectOne.rootFolder[0]._id.toString() projectOne.rootFolder[0].fileRefs.push({ linkedFileData: { provider: 'project_file', v1_source_doc_id: 9999999, // We won't find this id in the database source_entity_path: 'example.jpeg', }, _id: 'abcd', rev: 0, created: new Date(), name: 'example.jpeg', }) await owner.saveProject(projectOne) }) it('should refuse to refresh', async function () { const { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file/abcd/refresh`, json: true, }) expect(response.statusCode).to.equal(409) expect(body).to.equal( 'Sorry, the source project is not yet imported to Overleaf v2. Please import it to Overleaf v2 to refresh this file' ) }) }) describe('creating a URL based linked file', function () { beforeEach(async function () { projectOneId = await owner.createProject('url-linked-files-project', { template: 'blank', }) projectOne = await owner.getProject(projectOneId) projectOneRootFolderId = projectOne.rootFolder[0]._id.toString() }) it('should download, create and replace a file', async function () { // downloading the initial file let { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: 'http://example.com/foo', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-1', }, }) expect(response.statusCode).to.equal(200) let updatedProject = await owner.getProject(projectOneId) let file = updatedProject.rootFolder[0].fileRefs[0] expect(file.linkedFileData).to.deep.equal({ provider: 'url', url: 'http://example.com/foo', }) ;({ response, body } = await owner.doRequest( 'get', `/project/${projectOneId}/file/${file._id}` )) expect(response.statusCode).to.equal(200) expect(body).to.equal('foo foo foo') // replacing the file ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: 'http://example.com/foo', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-2', }, })) expect(response.statusCode).to.equal(200) ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: 'http://example.com/bar', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-2', }, })) expect(response.statusCode).to.equal(200) updatedProject = await owner.getProject(projectOneId) file = updatedProject.rootFolder[0].fileRefs[1] expect(file.linkedFileData).to.deep.equal({ provider: 'url', url: 'http://example.com/bar', }) ;({ response, body } = await owner.doRequest( 'get', `/project/${projectOneId}/file/${file._id}` )) expect(response.statusCode).to.equal(200) expect(body).to.equal('bar bar bar') }) it("should return an error if the file can't be downloaded", async function () { // download does not succeed let { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: 'http://example.com/does-not-exist', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-3', }, }) expect(response.statusCode).to.equal(422) // unprocessable expect(body).to.equal( 'Your URL could not be reached (404 status code). Please check it and try again.' ) // url is invalid ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: '!^$%', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-4', }, })) expect(response.statusCode).to.equal(422) // unprocessable expect(body).to.equal( 'Your URL is not valid. Please check it and try again.' ) // URL is non-http ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: 'ftp://localhost', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-5', }, })) expect(response.statusCode).to.equal(422) // unprocessable expect(body).to.equal( 'Your URL is not valid. Please check it and try again.' ) }) it('should accept a URL withuot a leading http://, and add it', async function () { let { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { provider: 'url', data: { url: 'example.com/foo', }, parent_folder_id: projectOneRootFolderId, name: 'url-test-file-6', }, }) expect(response.statusCode).to.equal(200) const updatedProject = await owner.getProject(projectOneId) const file = _.find( updatedProject.rootFolder[0].fileRefs, file => file.name === 'url-test-file-6' ) expect(file.linkedFileData).to.deep.equal({ provider: 'url', url: 'http://example.com/foo', }) ;({ response, body } = await owner.doRequest( 'get', `/project/${projectOneId}/file/${file._id}` )) expect(response.statusCode).to.equal(200) expect(body).to.equal('foo foo foo') }) }) // TODO: Add test for asking for host that return ENOTFOUND // (This will probably end up handled by the proxy) describe('creating a linked output file', function () { beforeEach(async function () { projectOneId = await owner.createProject('output-test-one', { template: 'blank', }) projectOne = await owner.getProject(projectOneId) projectOneRootFolderId = projectOne.rootFolder[0]._id.toString() projectTwoId = await owner.createProject('output-test-two', { template: 'blank', }) projectTwo = await owner.getProject(projectTwoId) projectTwoRootFolderId = projectTwo.rootFolder[0]._id.toString() }) it('should import the project.pdf file from the source project and refresh it', async function () { // import the file let { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file`, json: { name: 'test.pdf', parent_folder_id: projectOneRootFolderId, provider: 'project_output_file', data: { source_project_id: projectTwoId, source_output_file_path: 'project.pdf', build_id: '1234-abcd', }, }, }) expect(response.statusCode).to.equal(200) const existingFileId = body.new_file_id expect(existingFileId).to.exist const updatedProject = await owner.getProject(projectOneId) const firstFile = updatedProject.rootFolder[0].fileRefs[0] expect(firstFile._id.toString()).to.equal(existingFileId.toString()) expect(firstFile.linkedFileData).to.deep.equal({ provider: 'project_output_file', source_project_id: projectTwoId, source_output_file_path: 'project.pdf', build_id: '1234-abcd', }) expect(firstFile.name).to.equal('test.pdf') // refresh the file ;({ response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file/${existingFileId}/refresh`, json: true, })) expect(response.statusCode).to.equal(200) const refreshedFileId = body.new_file_id expect(refreshedFileId).to.exist expect(refreshedFileId).to.not.equal(existingFileId) const refreshedProject = await owner.getProject(projectOneId) const refreshedFile = refreshedProject.rootFolder[0].fileRefs[0] expect(refreshedFile._id.toString()).to.equal(refreshedFileId.toString()) expect(refreshedFile.name).to.equal('test.pdf') }) }) describe('with a linked project_output_file from a v1 project that has not been imported', function () { beforeEach(async function () { projectOneId = await owner.createProject('output-v1-test-one', { template: 'blank', }) projectOne = await owner.getProject(projectOneId) projectOneRootFolderId = projectOne.rootFolder[0]._id.toString() projectOne.rootFolder[0].fileRefs.push({ linkedFileData: { provider: 'project_output_file', v1_source_doc_id: 9999999, // We won't find this id in the database source_output_file_path: 'project.pdf', }, _id: 'abcdef', rev: 0, created: new Date(), name: 'whatever.pdf', }) await owner.saveProject(projectOne) }) it('should refuse to refresh', async function () { const { response, body } = await owner.doRequest('post', { url: `/project/${projectOneId}/linked_file/abcdef/refresh`, json: true, }) expect(response.statusCode).to.equal(409) expect(body).to.equal( 'Sorry, the source project is not yet imported to Overleaf v2. Please import it to Overleaf v2 to refresh this file' ) }) }) })
overleaf/web/test/acceptance/src/LinkedFilesTests.js/0
{ "file_path": "overleaf/web/test/acceptance/src/LinkedFilesTests.js", "repo_id": "overleaf", "token_count": 6605 }
566
/* eslint-disable camelcase, node/handle-callback-err, 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 * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const { assert } = require('chai') const async = require('async') const User = require('./helpers/User') const request = require('./helpers/request') const assert_has_common_headers = function (response) { const { headers } = response assert.equal(headers['x-download-options'], 'noopen') assert.equal(headers['x-xss-protection'], '1; mode=block') return assert.equal(headers['referrer-policy'], 'origin-when-cross-origin') } const assert_has_cache_headers = function (response) { const { headers } = response assert.equal(headers['surrogate-control'], 'no-store') assert.equal( headers['cache-control'], 'no-store, no-cache, must-revalidate, proxy-revalidate' ) assert.equal(headers.pragma, 'no-cache') return assert.equal(headers.expires, '0') } const assert_has_no_cache_headers = function (response) { const { headers } = response assert.isUndefined(headers['surrogate-control']) assert.isUndefined(headers['cache-control']) assert.isUndefined(headers.pragma) return assert.isUndefined(headers.expires) } const assert_has_asset_caching_headers = function (response) { const { headers } = response assert.equal(headers['cache-control'], 'public, max-age=31536000') } describe('SecurityHeaders', function () { beforeEach(function () { return (this.user = new User()) }) it('should not have x-powered-by header', function (done) { return request.get('/', (err, res, body) => { assert.isUndefined(res.headers['x-powered-by']) return done() }) }) it('should have all common headers', function (done) { return request.get('/', (err, res, body) => { assert_has_common_headers(res) return done() }) }) it('should not have cache headers on public pages', function (done) { return request.get('/', (err, res, body) => { assert_has_no_cache_headers(res) return done() }) }) it('should have caching headers on static assets', function (done) { request.get('/favicon.ico', (err, res) => { assert_has_asset_caching_headers(res) done(err) }) }) it('should have cache headers when user is logged in', function (done) { return async.series( [ cb => this.user.login(cb), cb => this.user.request.get('/', cb), cb => this.user.logout(cb), ], (err, results) => { const main_response = results[1][0] assert_has_cache_headers(main_response) return done() } ) }) it('should have cache headers on project page', function (done) { return async.series( [ cb => this.user.login(cb), cb => { return this.user.createProject( 'public-project', (error, project_id) => { if (error != null) { return done(error) } this.project_id = project_id return this.user.makePublic(this.project_id, 'readAndWrite', cb) } ) }, cb => this.user.logout(cb), ], (err, results) => { return request.get(`/project/${this.project_id}`, (err, res, body) => { assert_has_cache_headers(res) return done() }) } ) }) it('should have caching headers on static assets when user is logged in', function (done) { async.series( [ cb => this.user.login(cb), cb => this.user.request.get('/favicon.ico', cb), cb => this.user.logout(cb), ], (err, results) => { const res = results[1][0] assert_has_asset_caching_headers(res) done() } ) }) })
overleaf/web/test/acceptance/src/SecurityHeadersTests.js/0
{ "file_path": "overleaf/web/test/acceptance/src/SecurityHeadersTests.js", "repo_id": "overleaf", "token_count": 1651 }
567
const { ObjectId } = require('mongodb') const Subscription = require('./Subscription') const MockRecurlyApiClass = require('../mocks/MockRecurlyApi') const RecurlyWrapper = require('../../../../app/src/Features/Subscription/RecurlyWrapper') let MockRecurlyApi before(function () { MockRecurlyApi = MockRecurlyApiClass.instance() }) class RecurlySubscription { constructor(options = {}) { options.recurlySubscription_id = ObjectId().toString() this.subscription = new Subscription(options) this.uuid = options.recurlySubscription_id this.state = options.state || 'active' this.tax_in_cents = 100 this.tax_rate = 0.2 this.unit_amount_in_cents = 500 this.currency = 'GBP' this.current_period_ends_at = new Date(2018, 4, 5) this.trial_ends_at = new Date(2018, 6, 7) this.account = { id: this.subscription.admin_id.toString(), email: options.account && options.account.email, hosted_login_token: options.account && options.account.hosted_login_token, } } ensureExists(callback) { this.subscription.ensureExists(error => { if (error) { return callback(error) } MockRecurlyApi.addMockSubscription(this) callback() }) } buildCallbackXml() { return RecurlyWrapper._buildXml('expired_subscription_notification', { subscription: { uuid: this.uuid, state: 'expired', plan: { plan_code: 'collaborator', }, }, account: { account_code: this.account.id, }, }) } } module.exports = RecurlySubscription
overleaf/web/test/acceptance/src/helpers/RecurlySubscription.js/0
{ "file_path": "overleaf/web/test/acceptance/src/helpers/RecurlySubscription.js", "repo_id": "overleaf", "token_count": 650 }
568
const AbstractMockApi = require('./AbstractMockApi') class MockFilestoreApi extends AbstractMockApi { reset() { this.files = {} } applyRoutes() { this.app.post('/project/:projectId/file/:fileId', (req, res) => { const chunks = [] req.on('data', chunk => chunks.push(chunk)) req.on('end', () => { const content = Buffer.concat(chunks).toString() const { projectId, fileId } = req.params if (!this.files[projectId]) { this.files[projectId] = {} } this.files[projectId][fileId] = { content } res.sendStatus(200) }) }) this.app.get('/project/:projectId/file/:fileId', (req, res) => { const { projectId, fileId } = req.params const { content } = this.files[projectId][fileId] res.send(content) }) // handle file copying this.app.put('/project/:projectId/file/:fileId', (req, res) => { const { projectId, fileId } = req.params const { source } = req.body const { content } = this.files[source.project_id] && this.files[source.project_id][source.file_id] if (!content) { res.sendStatus(500) } else { if (!this.files[projectId]) { this.files[projectId] = {} } this.files[projectId][fileId] = { content } res.sendStatus(200) } }) this.app.delete('/project/:projectId', (req, res) => { const { projectId } = req.params delete this.files[projectId] res.sendStatus(204) }) } getFile(projectId, fileId) { return ( this.files[projectId] && this.files[projectId][fileId] && this.files[projectId][fileId].content ) } } module.exports = MockFilestoreApi // type hint for the inherited `instance` method /** * @function instance * @memberOf MockFilestoreApi * @static * @returns {MockFilestoreApi} */
overleaf/web/test/acceptance/src/mocks/MockFilestoreApi.js/0
{ "file_path": "overleaf/web/test/acceptance/src/mocks/MockFilestoreApi.js", "repo_id": "overleaf", "token_count": 825 }
569
import { expect } from 'chai' import { render, screen } from '@testing-library/react' import ChatToggleButton from '../../../../../frontend/js/features/editor-navigation-toolbar/components/chat-toggle-button' describe('<ChatToggleButton />', function () { const defaultProps = { chatIsOpen: false, unreadMessageCount: 0, onClick: () => {}, } it('displays the number of unread messages', function () { const props = { ...defaultProps, unreadMessageCount: 113, } render(<ChatToggleButton {...props} />) screen.getByText('113') }) it("doesn't display the unread messages badge when the number of unread messages is zero", function () { render(<ChatToggleButton {...defaultProps} />) expect(screen.queryByText('0')).to.not.exist }) })
overleaf/web/test/frontend/features/editor-navigation-toolbar/components/chat-toggle-button.test.js/0
{ "file_path": "overleaf/web/test/frontend/features/editor-navigation-toolbar/components/chat-toggle-button.test.js", "repo_id": "overleaf", "token_count": 277 }
570
import { expect } from 'chai' import sinon from 'sinon' import { screen, fireEvent, waitFor } from '@testing-library/react' import fetchMock from 'fetch-mock' import MockedSocket from 'socket.io-mock' import { renderWithEditorContext, cleanUpContext, } from '../../../helpers/render-with-context' import FileTreeRoot from '../../../../../frontend/js/features/file-tree/components/file-tree-root' describe('FileTree Create Folder Flow', function () { const onSelect = sinon.stub() const onInit = sinon.stub() beforeEach(function () { global.requestAnimationFrame = sinon.stub() }) afterEach(function () { delete global.requestAnimationFrame fetchMock.restore() onSelect.reset() onInit.reset() cleanUpContext() }) it('add to root when no files are selected', async function () { const rootFolder = [ { _id: 'root-folder-id', docs: [{ _id: '456def', name: 'main.tex' }], folders: [], fileRefs: [], }, ] renderWithEditorContext( <FileTreeRoot rootFolder={rootFolder} projectId="123abc" hasWritePermissions userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} setStartedFreeTrial={() => null} onSelect={onSelect} onInit={onInit} isConnected />, { socket: new MockedSocket() } ) const newFolderName = 'Foo Bar In Root' const matcher = /\/project\/\w+\/folder/ const response = { folders: [], fileRefs: [], docs: [], _id: fakeId(), name: newFolderName, } fetchMock.post(matcher, response) await fireCreateFolder(newFolderName) const lastCallBody = JSON.parse(fetchMock.lastCall(matcher)[1].body) expect(lastCallBody.name).to.equal(newFolderName) expect(lastCallBody.parent_folder_id).to.equal('root-folder-id') window._ide.socket.socketClient.emit('reciveNewFolder', 'root-folder-id', { _id: fakeId(), name: newFolderName, docs: [], fileRefs: [], folders: [], }) await screen.findByRole('treeitem', { name: newFolderName }) }) it('add to folder from folder', async function () { const rootFolder = [ { _id: 'root-folder-id', docs: [], folders: [ { _id: '789ghi', name: 'thefolder', docs: [], fileRefs: [], folders: [], }, ], fileRefs: [], }, ] renderWithEditorContext( <FileTreeRoot rootFolder={rootFolder} projectId="123abc" hasWritePermissions userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} setStartedFreeTrial={() => null} rootDocId="789ghi" onSelect={onSelect} onInit={onInit} isConnected />, { socket: new MockedSocket() } ) const expandButton = screen.getByRole('button', { name: 'Expand' }) fireEvent.click(expandButton) const newFolderName = 'Foo Bar In thefolder' const matcher = /\/project\/\w+\/folder/ const response = { folders: [], fileRefs: [], docs: [], _id: fakeId(), name: newFolderName, } fetchMock.post(matcher, response) await fireCreateFolder(newFolderName) const lastCallBody = JSON.parse(fetchMock.lastCall(matcher)[1].body) expect(lastCallBody.name).to.equal(newFolderName) expect(lastCallBody.parent_folder_id).to.equal('789ghi') window._ide.socket.socketClient.emit('reciveNewFolder', '789ghi', { _id: fakeId(), name: newFolderName, docs: [], fileRefs: [], folders: [], }) // find the created folder await screen.findByRole('treeitem', { name: newFolderName }) // collapse the parent folder; created folder should not be rendered anymore fireEvent.click(expandButton) expect(screen.queryByRole('treeitem', { name: newFolderName })).to.not.exist }) it('add to folder from child', async function () { const rootFolder = [ { _id: 'root-folder-id', docs: [], folders: [ { _id: '789ghi', name: 'thefolder', docs: [], fileRefs: [{ _id: '456def', name: 'sub.tex' }], folders: [], }, ], fileRefs: [], }, ] renderWithEditorContext( <FileTreeRoot rootFolder={rootFolder} projectId="123abc" hasWritePermissions userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} setStartedFreeTrial={() => null} rootDocId="456def" onSelect={onSelect} onInit={onInit} isConnected />, { socket: new MockedSocket() } ) const newFolderName = 'Foo Bar In thefolder' const matcher = /\/project\/\w+\/folder/ const response = { folders: [], fileRefs: [], docs: [], _id: fakeId(), name: newFolderName, } fetchMock.post(matcher, response) await fireCreateFolder(newFolderName) const lastCallBody = JSON.parse(fetchMock.lastCall(matcher)[1].body) expect(lastCallBody.name).to.equal(newFolderName) expect(lastCallBody.parent_folder_id).to.equal('789ghi') window._ide.socket.socketClient.emit('reciveNewFolder', '789ghi', { _id: fakeId(), name: newFolderName, docs: [], fileRefs: [], folders: [], }) // find the created folder await screen.findByRole('treeitem', { name: newFolderName }) // collapse the parent folder; created folder should not be rendered anymore fireEvent.click(screen.getByRole('button', { name: 'Collapse' })) expect(screen.queryByRole('treeitem', { name: newFolderName })).to.not.exist }) it('prevents adding duplicate or invalid names', async function () { const rootFolder = [ { _id: 'root-folder-id', docs: [{ _id: '456def', name: 'existingFile' }], folders: [], fileRefs: [], }, ] renderWithEditorContext( <FileTreeRoot rootFolder={rootFolder} projectId="123abc" hasWritePermissions userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} setStartedFreeTrial={() => null} rootDocId="456def" onSelect={onSelect} onInit={onInit} isConnected />, { socket: new MockedSocket() } ) var newFolderName = 'existingFile' await fireCreateFolder(newFolderName) expect(fetchMock.called()).to.be.false await screen.findByRole('alert', { name: 'A file or folder with this name already exists', hidden: true, }) newFolderName = 'in/valid ' setFolderName(newFolderName) await screen.findByRole('alert', { name: 'File name is empty or contains invalid characters', hidden: true, }) }) async function fireCreateFolder(name) { const createFolderButton = screen.getByRole('button', { name: 'New Folder', }) fireEvent.click(createFolderButton) setFolderName(name) const modalCreateButton = await getModalCreateButton() fireEvent.click(modalCreateButton) } function setFolderName(name) { const input = screen.getByRole('textbox') fireEvent.change(input, { target: { value: name } }) } function fakeId() { return Math.random().toString(16).replace(/0\./, 'random-test-id-') } async function getModalCreateButton() { return waitFor(() => screen.getByRole('button', { name: 'Create' })) } })
overleaf/web/test/frontend/features/file-tree/flows/create-folder.test.js/0
{ "file_path": "overleaf/web/test/frontend/features/file-tree/flows/create-folder.test.js", "repo_id": "overleaf", "token_count": 3347 }
571
import { expect } from 'chai' import { screen, render } from '@testing-library/react' import PreviewDownloadFileList, { topFileTypes, } from '../../../../../frontend/js/features/preview/components/preview-download-file-list' describe('<PreviewDownloadFileList />', function () { const projectId = 'projectId123' function makeFile(fileName, main) { return { fileName, url: `/project/${projectId}/output/${fileName}`, type: fileName.split('.').pop(), main: main || false, } } it('should list all output files and group them', function () { const outputFiles = [ makeFile('output.ind'), makeFile('output.log'), makeFile('output.pdf', true), makeFile('alt.pdf'), makeFile('output.stderr'), makeFile('output.stdout'), makeFile('output.aux'), makeFile('output.bbl'), makeFile('output.blg'), ] render(<PreviewDownloadFileList fileList={outputFiles} />) const menuItems = screen.getAllByRole('menuitem') expect(menuItems.length).to.equal(outputFiles.length - 1) // main PDF is listed separately const fileTypes = outputFiles.map(file => { return file.type }) menuItems.forEach((item, index) => { // check displayed text const fileType = item.textContent.split('.').pop() expect(fileTypes).to.include(fileType) }) // check grouped correctly expect(topFileTypes).to.exist expect(topFileTypes.length).to.be.above(0) const outputTopFileTypes = outputFiles .filter(file => { return topFileTypes.includes(file.type) }) .map(file => file.type) const topMenuItems = menuItems.slice(0, outputTopFileTypes.length) topMenuItems.forEach(item => { const fileType = item.textContent.split('.').pop().replace(' file', '') expect(topFileTypes.includes(fileType)).to.be.true }) }) it('should list all files when there are duplicate types', function () { const pdfFile = makeFile('output.pdf', true) const bblFile = makeFile('output.bbl') const outputFiles = [Object.assign({}, { ...bblFile }), bblFile, pdfFile] render(<PreviewDownloadFileList fileList={outputFiles} />) const bblMenuItems = screen.getAllByText((content, element) => { return content !== '' && element.textContent === 'output.bbl' }) expect(bblMenuItems.length).to.equal(2) }) it('should list the non-main PDF in the dropdown', function () { const pdfFile = makeFile('output.pdf', true) const pdfAltFile = makeFile('alt.pdf') const outputFiles = [pdfFile, pdfAltFile] render(<PreviewDownloadFileList fileList={outputFiles} />) screen.getAllByRole('menuitem', { name: 'alt.pdf' }) }) describe('list divider and header', function () { it('should display when there are top files and other files', function () { const outputFiles = [ makeFile('output.bbl'), makeFile('output.ind'), makeFile('output.gls'), makeFile('output.log'), ] render(<PreviewDownloadFileList fileList={outputFiles} />) screen.getByText('Download other output files') screen.getByRole('separator') }) it('should not display when there are top files and no other files', function () { const outputFiles = [ makeFile('output.bbl'), makeFile('output.ind'), makeFile('output.gls'), ] render(<PreviewDownloadFileList fileList={outputFiles} />) expect(screen.queryByText('Other output files')).to.not.exist expect(screen.queryByRole('separator')).to.not.exist }) it('should not display when there are other files and no top files', function () { const outputFiles = [makeFile('output.log')] render(<PreviewDownloadFileList fileList={outputFiles} />) expect(screen.queryByText('Other output files')).to.not.exist expect(screen.queryByRole('separator')).to.not.exist }) }) })
overleaf/web/test/frontend/features/preview/components/preview-download-file-list.test.js/0
{ "file_path": "overleaf/web/test/frontend/features/preview/components/preview-download-file-list.test.js", "repo_id": "overleaf", "token_count": 1443 }
572
import { expect } from 'chai' import { render, screen } from '@testing-library/react' import Pagination from '../../../../frontend/js/shared/components/pagination' describe('<Pagination />', function () { it('renders with current page handled', async function () { render( <Pagination currentPage={6} totalPages={10} handlePageClick={() => {}} /> ) await screen.findByLabelText('Page 6, Current Page') }) it('renders with nearby page buttons and prev/next button', async function () { render( <Pagination currentPage={2} totalPages={4} handlePageClick={() => {}} /> ) await screen.findByLabelText('Page 2, Current Page') await screen.findByLabelText('Go to page 1') await screen.findByLabelText('Go to page 3') await screen.findByLabelText('Go to page 4') await screen.findByLabelText('Go to Previous Page') await screen.findByLabelText('Go to Next Page') }) it('does not render the prev button when expected', async function () { render( <Pagination currentPage={1} totalPages={2} handlePageClick={() => {}} /> ) await screen.findByLabelText('Page 1, Current Page') await screen.findByLabelText('Go to Next Page') expect(screen.queryByLabelText('Go to Prev Page')).to.be.null }) it('does not render the next button when expected', async function () { render( <Pagination currentPage={2} totalPages={2} handlePageClick={() => {}} /> ) await screen.findByLabelText('Page 2, Current Page') await screen.findByLabelText('Go to Previous Page') expect(screen.queryByLabelText('Go to Next Page')).to.be.null }) it('renders 1 ellipses when there are more pages than buttons and on first page', async function () { render( <Pagination currentPage={1} totalPages={10} handlePageClick={() => {}} /> ) const ellipses = await screen.findAllByText('…') expect(ellipses.length).to.equal(1) }) it('renders 1 ellipses when on last page and there are more previous pages than buttons', async function () { render( <Pagination currentPage={10} totalPages={10} handlePageClick={() => {}} /> ) const ellipses = await screen.findAllByText('…') expect(ellipses.length).to.equal(1) }) it('renders 2 ellipses when there are more pages than buttons', async function () { render( <Pagination currentPage={5} totalPages={10} handlePageClick={() => {}} /> ) const ellipses = await screen.findAllByText('…') expect(ellipses.length).to.equal(2) }) it('only renders the number of page buttons set by maxOtherPageButtons', async function () { render( <Pagination currentPage={1} totalPages={100} handlePageClick={() => {}} /> ) const items = document.querySelectorAll('button') expect(items.length).to.equal(6) // 5 page buttons + next button }) })
overleaf/web/test/frontend/shared/components/pagination.test.js/0
{ "file_path": "overleaf/web/test/frontend/shared/components/pagination.test.js", "repo_id": "overleaf", "token_count": 966 }
573
const Settings = require('@overleaf/settings') async function run({ assertHasStatusCode, request }) { const response = await request(`/project/${Settings.smokeTest.projectId}`) assertHasStatusCode(response, 200) const PROJECT_ID_REGEX = new RegExp( `<meta name="ol-project_id" content="${Settings.smokeTest.projectId}">` ) if (!PROJECT_ID_REGEX.test(response.body)) { throw new Error('project page html does not have project_id') } } module.exports = { run }
overleaf/web/test/smoke/src/steps/101_loadEditor.js/0
{ "file_path": "overleaf/web/test/smoke/src/steps/101_loadEditor.js", "repo_id": "overleaf", "token_count": 161 }
574
/* 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 path = require('path') const sinon = require('sinon') const modulePath = path.join( __dirname, '../../../../app/src/Features/Chat/ChatApiHandler' ) const { expect } = require('chai') describe('ChatApiHandler', function () { beforeEach(function () { this.settings = { apis: { chat: { internal_url: 'chat.sharelatex.env', }, }, } this.request = sinon.stub() this.ChatApiHandler = SandboxedModule.require(modulePath, { requires: { '@overleaf/settings': this.settings, request: this.request, }, }) this.project_id = '3213213kl12j' this.user_id = '2k3jlkjs9' this.content = 'my message here' return (this.callback = sinon.stub()) }) describe('sendGlobalMessage', function () { describe('successfully', function () { beforeEach(function () { this.message = { mock: 'message' } this.request.callsArgWith(1, null, { statusCode: 200 }, this.message) return this.ChatApiHandler.sendGlobalMessage( this.project_id, this.user_id, this.content, this.callback ) }) it('should post the data to the chat api', function () { return this.request .calledWith({ url: `${this.settings.apis.chat.internal_url}/project/${this.project_id}/messages`, method: 'POST', json: { content: this.content, user_id: this.user_id, }, }) .should.equal(true) }) it('should return the message from the post', function () { return this.callback.calledWith(null, this.message).should.equal(true) }) }) describe('with a non-success status code', function () { beforeEach(function () { this.request.callsArgWith(1, null, { statusCode: 500 }) return this.ChatApiHandler.sendGlobalMessage( this.project_id, this.user_id, this.content, this.callback ) }) it('should return an error', function () { expect(this.callback).to.have.been.calledWith( sinon.match.instanceOf(Error).and(sinon.match.has('statusCode', 500)) ) }) }) }) describe('getGlobalMessages', function () { beforeEach(function () { this.messages = [{ mock: 'message' }] this.limit = 30 return (this.before = '1234') }) describe('successfully', function () { beforeEach(function () { this.request.callsArgWith(1, null, { statusCode: 200 }, this.messages) return this.ChatApiHandler.getGlobalMessages( this.project_id, this.limit, this.before, this.callback ) }) it('should make get request for room to chat api', function () { return this.request .calledWith({ method: 'GET', url: `${this.settings.apis.chat.internal_url}/project/${this.project_id}/messages`, qs: { limit: this.limit, before: this.before, }, json: true, }) .should.equal(true) }) it('should return the messages from the request', function () { return this.callback.calledWith(null, this.messages).should.equal(true) }) }) describe('with failure error code', function () { beforeEach(function () { this.request.callsArgWith(1, null, { statusCode: 500 }, null) return this.ChatApiHandler.getGlobalMessages( this.project_id, this.limit, this.before, this.callback ) }) it('should return an error', function () { expect(this.callback).to.have.been.calledWith( sinon.match.instanceOf(Error).and(sinon.match.has('statusCode', 500)) ) }) }) }) })
overleaf/web/test/unit/src/Chat/ChatApiHandlerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Chat/ChatApiHandlerTests.js", "repo_id": "overleaf", "token_count": 1923 }
575
/* eslint-disable node/handle-callback-err, 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 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const SandboxedModule = require('sandboxed-module') const sinon = require('sinon') const { expect } = require('chai') const modulePath = require('path').join( __dirname, '../../../../app/src/Features/Cooldown/CooldownManager' ) describe('CooldownManager', function () { beforeEach(function () { this.projectId = 'abcdefg' this.rclient = { set: sinon.stub(), get: sinon.stub() } this.RedisWrapper = { client: () => this.rclient } return (this.CooldownManager = SandboxedModule.require(modulePath, { requires: { '../../infrastructure/RedisWrapper': this.RedisWrapper, }, })) }) describe('_buildKey', function () { it('should build a properly formatted redis key', function () { return expect(this.CooldownManager._buildKey('ABC')).to.equal( 'Cooldown:{ABC}' ) }) }) describe('isProjectOnCooldown', function () { beforeEach(function () { return (this.call = cb => { return this.CooldownManager.isProjectOnCooldown(this.projectId, cb) }) }) describe('when project is on cooldown', function () { beforeEach(function () { return (this.rclient.get = sinon.stub().callsArgWith(1, null, '1')) }) it('should fetch key from redis', function (done) { return this.call((err, result) => { this.rclient.get.callCount.should.equal(1) this.rclient.get.calledWith('Cooldown:{abcdefg}').should.equal(true) return done() }) }) it('should not produce an error', function (done) { return this.call((err, result) => { expect(err).to.equal(null) return done() }) }) it('should produce a true result', function (done) { return this.call((err, result) => { expect(result).to.equal(true) return done() }) }) }) describe('when project is not on cooldown', function () { beforeEach(function () { return (this.rclient.get = sinon.stub().callsArgWith(1, null, null)) }) it('should fetch key from redis', function (done) { return this.call((err, result) => { this.rclient.get.callCount.should.equal(1) this.rclient.get.calledWith('Cooldown:{abcdefg}').should.equal(true) return done() }) }) it('should not produce an error', function (done) { return this.call((err, result) => { expect(err).to.equal(null) return done() }) }) it('should produce a false result', function (done) { return this.call((err, result) => { expect(result).to.equal(false) return done() }) }) }) describe('when rclient.get produces an error', function () { beforeEach(function () { return (this.rclient.get = sinon .stub() .callsArgWith(1, new Error('woops'))) }) it('should fetch key from redis', function (done) { return this.call((err, result) => { this.rclient.get.callCount.should.equal(1) this.rclient.get.calledWith('Cooldown:{abcdefg}').should.equal(true) return done() }) }) it('should produce an error', function (done) { return this.call((err, result) => { expect(err).to.not.equal(null) expect(err).to.be.instanceof(Error) return done() }) }) }) }) describe('putProjectOnCooldown', function () { beforeEach(function () { return (this.call = cb => { return this.CooldownManager.putProjectOnCooldown(this.projectId, cb) }) }) describe('when rclient.set does not produce an error', function () { beforeEach(function () { return (this.rclient.set = sinon.stub().callsArgWith(4, null)) }) it('should set a key in redis', function (done) { return this.call(err => { this.rclient.set.callCount.should.equal(1) this.rclient.set.calledWith('Cooldown:{abcdefg}').should.equal(true) return done() }) }) it('should not produce an error', function (done) { return this.call(err => { expect(err).to.equal(null) return done() }) }) }) describe('when rclient.set produces an error', function () { beforeEach(function () { return (this.rclient.set = sinon .stub() .callsArgWith(4, new Error('woops'))) }) it('should set a key in redis', function (done) { return this.call(err => { this.rclient.set.callCount.should.equal(1) this.rclient.set.calledWith('Cooldown:{abcdefg}').should.equal(true) return done() }) }) it('produce an error', function (done) { return this.call(err => { expect(err).to.not.equal(null) expect(err).to.be.instanceof(Error) return done() }) }) }) }) })
overleaf/web/test/unit/src/Cooldown/CooldownManagerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Cooldown/CooldownManagerTests.js", "repo_id": "overleaf", "token_count": 2301 }
576
const { expect } = require('chai') const MockResponse = require('../helpers/MockResponse') const MockRequest = require('../helpers/MockRequest') const SandboxedModule = require('sandboxed-module') const modulePath = '../../../../app/src/Features/Errors/HttpErrorHandler.js' describe('HttpErrorHandler', function () { beforeEach(function () { this.req = new MockRequest() this.res = new MockResponse() this.HttpErrorHandler = SandboxedModule.require(modulePath, { requires: { '@overleaf/settings': { appName: 'Overleaf', statusPageUrl: 'https://status.overlaf.com', }, }, }) }) describe('handleErrorByStatusCode', function () { it('returns the http status code of 400 errors', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 400 ) expect(this.res.statusCode).to.equal(400) }) it('returns the http status code of 500 errors', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 500 ) expect(this.res.statusCode).to.equal(500) }) it('returns the http status code of any 5xx error', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 588 ) expect(this.res.statusCode).to.equal(588) }) it('returns the http status code of any 4xx error', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 488 ) expect(this.res.statusCode).to.equal(488) }) it('returns 500 for http status codes smaller than 400', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 302 ) expect(this.res.statusCode).to.equal(500) }) it('returns 500 for http status codes larger than 600', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 302 ) expect(this.res.statusCode).to.equal(500) }) it('returns 500 when the error has no http status code', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode(this.req, this.res, err) expect(this.res.statusCode).to.equal(500) }) it('uses the conflict() error handler', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 409 ) expect(this.res.body).to.equal('conflict') }) it('uses the forbidden() error handler', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 403 ) expect(this.res.body).to.equal('restricted') }) it('uses the notFound() error handler', function () { const err = new Error() this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 404 ) expect(this.res.body).to.equal('not found') }) it('uses the unprocessableEntity() error handler', function () { const err = new Error() err.httpStatusCode = 422 this.HttpErrorHandler.handleErrorByStatusCode( this.req, this.res, err, 422 ) expect(this.res.body).to.equal('unprocessable entity') }) }) describe('badRequest', function () { it('returns 400', function () { this.HttpErrorHandler.badRequest(this.req, this.res) expect(this.res.statusCode).to.equal(400) }) it('should print a message when no content-type is included', function () { this.HttpErrorHandler.badRequest(this.req, this.res) expect(this.res.body).to.equal('client error') }) it("should render a template including the error message when content-type is 'html'", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.badRequest(this.req, this.res, 'an error') expect(this.res.renderedTemplate).to.equal('general/400') expect(this.res.renderedVariables).to.deep.equal({ title: 'Client Error', message: 'an error', }) }) it("should render a default template when content-type is 'html' and no message is provided", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.badRequest(this.req, this.res) expect(this.res.renderedTemplate).to.equal('general/400') expect(this.res.renderedVariables).to.deep.equal({ title: 'Client Error', message: undefined, }) }) it("should return a json object when content-type is 'json'", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.badRequest(this.req, this.res, 'an error', { foo: 'bar', }) expect(JSON.parse(this.res.body)).to.deep.equal({ message: 'an error', foo: 'bar', }) }) it("should return an empty json object when content-type is 'json' and no message and info are provided", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.badRequest(this.req, this.res) expect(JSON.parse(this.res.body)).to.deep.equal({}) }) }) describe('conflict', function () { it('returns 409', function () { this.HttpErrorHandler.conflict(this.req, this.res) expect(this.res.statusCode).to.equal(409) }) it('should print a message when no content-type is included', function () { this.HttpErrorHandler.conflict(this.req, this.res) expect(this.res.body).to.equal('conflict') }) it("should render a template including the error message when content-type is 'html'", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.unprocessableEntity(this.req, this.res, 'an error') expect(this.res.renderedTemplate).to.equal('general/400') expect(this.res.renderedVariables).to.deep.equal({ title: 'Client Error', message: 'an error', }) }) it("should return a json object when content-type is 'json'", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.unprocessableEntity( this.req, this.res, 'an error', { foo: 'bar', } ) expect(JSON.parse(this.res.body)).to.deep.equal({ message: 'an error', foo: 'bar', }) }) }) describe('forbidden', function () { it('returns 403', function () { this.HttpErrorHandler.forbidden(this.req, this.res) expect(this.res.statusCode).to.equal(403) }) it('should print a message when no content-type is included', function () { this.HttpErrorHandler.forbidden(this.req, this.res) expect(this.res.body).to.equal('restricted') }) it("should render a template when content-type is 'html'", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.forbidden(this.req, this.res) expect(this.res.renderedTemplate).to.equal('user/restricted') expect(this.res.renderedVariables).to.deep.equal({ title: 'restricted', }) }) it("should return a json object when content-type is 'json'", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.forbidden(this.req, this.res, 'an error', { foo: 'bar', }) expect(JSON.parse(this.res.body)).to.deep.equal({ message: 'an error', foo: 'bar', }) }) }) describe('notFound', function () { it('returns 404', function () { this.HttpErrorHandler.notFound(this.req, this.res) expect(this.res.statusCode).to.equal(404) }) it('should print a message when no content-type is included', function () { this.HttpErrorHandler.notFound(this.req, this.res) expect(this.res.body).to.equal('not found') }) it("should render a template when content-type is 'html'", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.notFound(this.req, this.res) expect(this.res.renderedTemplate).to.equal('general/404') expect(this.res.renderedVariables).to.deep.equal({ title: 'page_not_found', }) }) it("should return a json object when content-type is 'json'", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.notFound(this.req, this.res, 'an error', { foo: 'bar', }) expect(JSON.parse(this.res.body)).to.deep.equal({ message: 'an error', foo: 'bar', }) }) }) describe('unprocessableEntity', function () { it('returns 422', function () { this.HttpErrorHandler.unprocessableEntity(this.req, this.res) expect(this.res.statusCode).to.equal(422) }) it('should print a message when no content-type is included', function () { this.HttpErrorHandler.unprocessableEntity(this.req, this.res) expect(this.res.body).to.equal('unprocessable entity') }) it("should render a template including the error message when content-type is 'html'", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.unprocessableEntity(this.req, this.res, 'an error') expect(this.res.renderedTemplate).to.equal('general/400') expect(this.res.renderedVariables).to.deep.equal({ title: 'Client Error', message: 'an error', }) }) it("should return a json object when content-type is 'json'", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.unprocessableEntity( this.req, this.res, 'an error', { foo: 'bar', } ) expect(JSON.parse(this.res.body)).to.deep.equal({ message: 'an error', foo: 'bar', }) }) describe('legacyInternal', function () { it('returns 500', function () { this.HttpErrorHandler.legacyInternal(this.req, this.res, new Error()) expect(this.res.statusCode).to.equal(500) }) it('should send the error to the logger', function () { const error = new Error('message') this.HttpErrorHandler.legacyInternal( this.req, this.res, 'message', error ) expect(this.logger.error).to.have.been.calledWith(error) }) it('should print a message when no content-type is included', function () { this.HttpErrorHandler.legacyInternal(this.req, this.res, new Error()) expect(this.res.body).to.equal('internal server error') }) it("should render a template when content-type is 'html'", function () { this.req.accepts = () => 'html' this.HttpErrorHandler.legacyInternal(this.req, this.res, new Error()) expect(this.res.renderedTemplate).to.equal('general/500') expect(this.res.renderedVariables).to.deep.equal({ title: 'Server Error', }) }) it("should return a json object with a static message when content-type is 'json'", function () { this.req.accepts = () => 'json' this.HttpErrorHandler.legacyInternal( this.req, this.res, 'a message', new Error() ) expect(JSON.parse(this.res.body)).to.deep.equal({ message: 'a message', }) }) }) }) })
overleaf/web/test/unit/src/Errors/HttpErrorHandlerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Errors/HttpErrorHandlerTests.js", "repo_id": "overleaf", "token_count": 4851 }
577
/* 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 path = require('path') const sinon = require('sinon') const modulePath = path.join( __dirname, '../../../../app/src/Features/Institutions/InstitutionsController' ) describe('InstitutionsController', function () { beforeEach(function () { this.host = 'mit.edu'.split('').reverse().join('') this.stubbedUser1 = { _id: '3131231', name: 'bob', email: 'hello@world.com', emails: [ { email: 'stubb1@mit.edu', reversedHostname: this.host }, { email: 'test@test.com', reversedHostname: 'test.com' }, { email: 'another@mit.edu', reversedHostname: this.host }, ], } this.stubbedUser1DecoratedEmails = [ { email: 'stubb1@mit.edu', reversedHostname: this.host, samlIdentifier: { hasEntitlement: false }, }, { email: 'test@test.com', reversedHostname: 'test.com' }, { email: 'another@mit.edu', reversedHostname: this.host, samlIdentifier: { hasEntitlement: true }, }, ] this.stubbedUser2 = { _id: '3131232', name: 'test', email: 'hello2@world.com', emails: [{ email: 'subb2@mit.edu', reversedHostname: this.host }], } this.stubbedUser2DecoratedEmails = [ { email: 'subb2@mit.edu', reversedHostname: this.host, }, ] this.getUsersByHostname = sinon.stub().callsArgWith( 2, null, [this.stubbedUser1, this.stubbedUser2].map(user => { return { _id: user._id } }) ) this.addAffiliation = sinon.stub().callsArgWith(3, null) this.refreshFeatures = sinon.stub().yields(null) this.getUserFullEmails = sinon.stub() this.getUserFullEmails .withArgs(this.stubbedUser1._id) .yields(null, this.stubbedUser1DecoratedEmails) this.getUserFullEmails .withArgs(this.stubbedUser2._id) .yields(null, this.stubbedUser2DecoratedEmails) this.InstitutionsController = SandboxedModule.require(modulePath, { requires: { '../User/UserGetter': { getUsersByHostname: this.getUsersByHostname, getUserFullEmails: this.getUserFullEmails, }, '../Institutions/InstitutionsAPI': { addAffiliation: this.addAffiliation, }, '../Subscription/FeaturesUpdater': { refreshFeatures: this.refreshFeatures, }, }, }) this.req = { body: { hostname: 'mit.edu' } } this.res = { send: sinon.stub(), json: sinon.stub(), } return (this.next = sinon.stub()) }) describe('affiliateUsers', function () { it('should add affiliations for matching users', function (done) { this.res.sendStatus = code => { code.should.equal(200) this.getUsersByHostname.calledOnce.should.equal(true) this.addAffiliation.calledThrice.should.equal(true) this.addAffiliation .calledWithMatch( this.stubbedUser1._id, this.stubbedUser1.emails[0].email, { entitlement: false } ) .should.equal(true) this.addAffiliation .calledWithMatch( this.stubbedUser1._id, this.stubbedUser1.emails[2].email, { entitlement: true } ) .should.equal(true) this.addAffiliation .calledWithMatch( this.stubbedUser2._id, this.stubbedUser2.emails[0].email, { entitlement: undefined } ) .should.equal(true) this.refreshFeatures .calledWith(this.stubbedUser1._id) .should.equal(true) this.refreshFeatures .calledWith(this.stubbedUser2._id) .should.equal(true) return done() } this.next.callsFake(done) return this.InstitutionsController.confirmDomain( this.req, this.res, this.next ) }) it('should return errors if last affiliation cannot be added', function (done) { this.addAffiliation.onCall(2).callsArgWith(3, new Error('error')) this.next = error => { expect(error).to.exist this.getUsersByHostname.calledOnce.should.equal(true) return done() } return this.InstitutionsController.confirmDomain( this.req, this.res, this.next ) }) }) })
overleaf/web/test/unit/src/Institutions/InstitutionsControllerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Institutions/InstitutionsControllerTests.js", "repo_id": "overleaf", "token_count": 2210 }
578
/* 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 { ObjectId } = require('mongodb') const Path = require('path') const SandboxedModule = require('sandboxed-module') const assert = require('assert') const { expect } = require('chai') const sinon = require('sinon') const modulePath = Path.join( __dirname, '../../../../app/src/Features/Project/ProjectCollabratecDetailsHandler' ) describe('ProjectCollabratecDetailsHandler', function () { beforeEach(function () { this.projectId = ObjectId('5bea8747c7bba6012fcaceb3') this.userId = ObjectId('5be316a9c7f6aa03802ea8fb') this.userId2 = ObjectId('5c1794b3f0e89b1d1c577eca') this.ProjectModel = {} this.ProjectCollabratecDetailsHandler = SandboxedModule.require( modulePath, { requires: { mongodb: { ObjectId }, '../../models/Project': { Project: this.ProjectModel }, }, } ) return (this.callback = sinon.stub()) }) describe('initializeCollabratecProject', function () { describe('when update succeeds', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields() return this.ProjectCollabratecDetailsHandler.initializeCollabratecProject( this.projectId, this.userId, 'collabratec-document-id', 'collabratec-private-group-id', this.callback ) }) it('should update project model', function () { const update = { $set: { collabratecUsers: [ { user_id: this.userId, collabratec_document_id: 'collabratec-document-id', collabratec_privategroup_id: 'collabratec-private-group-id', }, ], }, } return expect(this.ProjectModel.updateOne).to.have.been.calledWith( { _id: this.projectId }, update, this.callback ) }) }) describe('when update has error', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields('error') return this.ProjectCollabratecDetailsHandler.initializeCollabratecProject( this.projectId, this.userId, 'collabratec-document-id', 'collabratec-private-group-id', this.callback ) }) it('should callback with error', function () { return expect(this.callback).to.have.been.calledWith('error') }) }) describe('with invalid args', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.initializeCollabratecProject( 'bad-project-id', 'bad-user-id', 'collabratec-document-id', 'collabratec-private-group-id', this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) }) describe('isLinkedCollabratecUserProject', function () { beforeEach(function () { return (this.ProjectModel.findOne = sinon.stub().yields()) }) describe('when find succeeds', function () { describe('when user project found', function () { beforeEach(function () { this.ProjectModel.findOne = sinon.stub().yields(null, 'project') return this.ProjectCollabratecDetailsHandler.isLinkedCollabratecUserProject( this.projectId, this.userId, this.callback ) }) it('should call find with project and user id', function () { return expect(this.ProjectModel.findOne).to.have.been.calledWithMatch( { _id: ObjectId(this.projectId), collabratecUsers: { $elemMatch: { user_id: ObjectId(this.userId), }, }, } ) }) it('should callback with true', function () { return expect(this.callback).to.have.been.calledWith(null, true) }) }) describe('when user project found', function () { beforeEach(function () { this.ProjectModel.findOne = sinon.stub().yields(null, null) return this.ProjectCollabratecDetailsHandler.isLinkedCollabratecUserProject( this.projectId, this.userId, this.callback ) }) it('should callback with false', function () { return expect(this.callback).to.have.been.calledWith(null, false) }) }) }) describe('when find has error', function () { beforeEach(function () { this.ProjectModel.findOne = sinon.stub().yields('error') return this.ProjectCollabratecDetailsHandler.isLinkedCollabratecUserProject( this.projectId, this.userId, this.callback ) }) it('should callback with error', function () { return expect(this.callback).to.have.been.calledWith('error') }) }) describe('with invalid args', function () { beforeEach(function () { this.ProjectModel.findOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.isLinkedCollabratecUserProject( 'bad-project-id', 'bad-user-id', this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.findOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) }) describe('linkCollabratecUserProject', function () { describe('when update succeeds', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields() return this.ProjectCollabratecDetailsHandler.linkCollabratecUserProject( this.projectId, this.userId, 'collabratec-document-id', this.callback ) }) it('should update project model', function () { const query = { _id: this.projectId, collabratecUsers: { $not: { $elemMatch: { collabratec_document_id: 'collabratec-document-id', user_id: this.userId, }, }, }, } const update = { $push: { collabratecUsers: { collabratec_document_id: 'collabratec-document-id', user_id: this.userId, }, }, } return expect(this.ProjectModel.updateOne).to.have.been.calledWith( query, update, this.callback ) }) }) describe('when update has error', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields('error') return this.ProjectCollabratecDetailsHandler.linkCollabratecUserProject( this.projectId, this.userId, 'collabratec-document-id', this.callback ) }) it('should callback with error', function () { return expect(this.callback).to.have.been.calledWith('error') }) }) describe('with invalid args', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.linkCollabratecUserProject( 'bad-project-id', 'bad-user-id', 'collabratec-document-id', this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) }) describe('setCollabratecUsers', function () { beforeEach(function () { return (this.collabratecUsers = [ { user_id: this.userId, collabratec_document_id: 'collabratec-document-id-1', collabratec_privategroup_id: 'collabratec-private-group-id-1', }, { user_id: this.userId2, collabratec_document_id: 'collabratec-document-id-2', collabratec_privategroup_id: 'collabratec-private-group-id-2', }, ]) }) describe('when update succeeds', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields() return this.ProjectCollabratecDetailsHandler.setCollabratecUsers( this.projectId, this.collabratecUsers, this.callback ) }) it('should update project model', function () { const update = { $set: { collabratecUsers: this.collabratecUsers, }, } return expect(this.ProjectModel.updateOne).to.have.been.calledWith( { _id: this.projectId }, update, this.callback ) }) }) describe('when update has error', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields('error') return this.ProjectCollabratecDetailsHandler.setCollabratecUsers( this.projectId, this.collabratecUsers, this.callback ) }) it('should callback with error', function () { return expect(this.callback).to.have.been.calledWith('error') }) }) describe('with invalid project_id', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.setCollabratecUsers( 'bad-project-id', this.collabratecUsers, this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) describe('with invalid user_id', function () { beforeEach(function () { this.collabratecUsers[1].user_id = 'bad-user-id' this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.setCollabratecUsers( this.projectId, this.collabratecUsers, this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) }) describe('unlinkCollabratecUserProject', function () { describe('when update succeeds', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields() return this.ProjectCollabratecDetailsHandler.unlinkCollabratecUserProject( this.projectId, this.userId, this.callback ) }) it('should update project model', function () { const query = { _id: this.projectId } const update = { $pull: { collabratecUsers: { user_id: this.userId, }, }, } return expect(this.ProjectModel.updateOne).to.have.been.calledWith( query, update, this.callback ) }) }) describe('when update has error', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub().yields('error') return this.ProjectCollabratecDetailsHandler.unlinkCollabratecUserProject( this.projectId, this.userId, this.callback ) }) it('should callback with error', function () { return expect(this.callback).to.have.been.calledWith('error') }) }) describe('with invalid args', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.unlinkCollabratecUserProject( 'bad-project-id', 'bad-user-id', this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) }) describe('updateCollabratecUserIds', function () { describe('when update succeeds', function () { beforeEach(function () { this.ProjectModel.updateMany = sinon.stub().yields() return this.ProjectCollabratecDetailsHandler.updateCollabratecUserIds( this.userId, this.userId2, this.callback ) }) it('should update project model', function () { return expect(this.ProjectModel.updateMany).to.have.been.calledWith( { 'collabratecUsers.user_id': this.userId }, { $set: { 'collabratecUsers.$.user_id': this.userId2 } }, this.callback ) }) }) describe('when update has error', function () { beforeEach(function () { this.ProjectModel.updateMany = sinon.stub().yields('error') return this.ProjectCollabratecDetailsHandler.updateCollabratecUserIds( this.userId, this.userId2, this.callback ) }) it('should callback with error', function () { return expect(this.callback).to.have.been.calledWith('error') }) }) describe('with invalid old_user_id', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.updateCollabratecUserIds( 'bad-user-id', this.userId2, this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) describe('with invalid new_user_id', function () { beforeEach(function () { this.ProjectModel.updateOne = sinon.stub() return this.ProjectCollabratecDetailsHandler.updateCollabratecUserIds( this.userId, 'bad-user-id', this.callback ) }) it('should not update', function () { return expect(this.ProjectModel.updateOne).not.to.have.been.called }) it('should callback with error', function () { return expect(this.callback.firstCall.args[0]).to.be.instanceOf(Error) }) }) }) })
overleaf/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js/0
{ "file_path": "overleaf/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js", "repo_id": "overleaf", "token_count": 6939 }
579
/* 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 { assert, expect } = require('chai') const sinon = require('sinon') const modulePath = '../../../../app/src/Features/Project/SafePath' const SandboxedModule = require('sandboxed-module') describe('SafePath', function () { beforeEach(function () { return (this.SafePath = SandboxedModule.require(modulePath)) }) describe('isCleanFilename', function () { it('should accept a valid filename "main.tex"', function () { const result = this.SafePath.isCleanFilename('main.tex') return result.should.equal(true) }) it('should not accept an empty filename', function () { const result = this.SafePath.isCleanFilename('') return result.should.equal(false) }) it('should not accept / anywhere', function () { const result = this.SafePath.isCleanFilename('foo/bar') return result.should.equal(false) }) it('should not accept .', function () { const result = this.SafePath.isCleanFilename('.') return result.should.equal(false) }) it('should not accept ..', function () { const result = this.SafePath.isCleanFilename('..') return result.should.equal(false) }) it('should not accept * anywhere', function () { const result = this.SafePath.isCleanFilename('foo*bar') return result.should.equal(false) }) it('should not accept leading whitespace', function () { const result = this.SafePath.isCleanFilename(' foobar.tex') return result.should.equal(false) }) it('should not accept trailing whitespace', function () { const result = this.SafePath.isCleanFilename('foobar.tex ') return result.should.equal(false) }) it('should not accept leading and trailing whitespace', function () { const result = this.SafePath.isCleanFilename(' foobar.tex ') return result.should.equal(false) }) it('should not accept control characters (0-31)', function () { const result = this.SafePath.isCleanFilename('foo\u0010bar') return result.should.equal(false) }) it('should not accept control characters (127, delete)', function () { const result = this.SafePath.isCleanFilename('foo\u007fbar') return result.should.equal(false) }) it('should not accept control characters (128-159)', function () { const result = this.SafePath.isCleanFilename('foo\u0080\u0090bar') return result.should.equal(false) }) it('should not accept surrogate characters (128-159)', function () { const result = this.SafePath.isCleanFilename('foo\uD800\uDFFFbar') return result.should.equal(false) }) it('should accept javascript property names', function () { const result = this.SafePath.isCleanFilename('prototype') return result.should.equal(true) }) it('should accept javascript property names in the prototype', function () { const result = this.SafePath.isCleanFilename('hasOwnProperty') return result.should.equal(true) }) // this test never worked correctly because the spaces are not replaced by underscores in isCleanFilename // it 'should not accept javascript property names resulting from substitutions', -> // result = @SafePath.isCleanFilename ' proto ' // result.should.equal false // it 'should not accept a trailing .', -> // result = @SafePath.isCleanFilename 'hello.' // result.should.equal false it('should not accept \\', function () { const result = this.SafePath.isCleanFilename('foo\\bar') return result.should.equal(false) }) it('should reject filenames regardless of order (/g) for bad characters', function () { const result1 = this.SafePath.isCleanFilename('foo*bar.tex') // * is not allowed const result2 = this.SafePath.isCleanFilename('*foobar.tex') // bad char location is before previous match return result1.should.equal(false) && result2.should.equal(false) }) it('should reject filenames regardless of order (/g) for bad filenames', function () { const result1 = this.SafePath.isCleanFilename('foo ') // trailing space const result2 = this.SafePath.isCleanFilename(' foobar') // leading space, match location is before previous match return result1.should.equal(false) && result2.should.equal(false) }) }) describe('isCleanPath', function () { it('should accept a valid filename "main.tex"', function () { const result = this.SafePath.isCleanPath('main.tex') return result.should.equal(true) }) it('should accept a valid path "foo/main.tex"', function () { const result = this.SafePath.isCleanPath('foo/main.tex') return result.should.equal(true) }) it('should accept empty path elements', function () { const result = this.SafePath.isCleanPath('foo//main.tex') return result.should.equal(true) }) it('should not accept an empty filename', function () { const result = this.SafePath.isCleanPath('foo/bar/') return result.should.equal(false) }) it('should accept a path that starts with a slash', function () { const result = this.SafePath.isCleanPath('/etc/passwd') return result.should.equal(true) }) it('should not accept a path that has an asterisk as the 0th element', function () { const result = this.SafePath.isCleanPath('*/foo/bar') return result.should.equal(false) }) it('should not accept a path that has an asterisk as a middle element', function () { const result = this.SafePath.isCleanPath('foo/*/bar') return result.should.equal(false) }) it('should not accept a path that has an asterisk as the filename', function () { const result = this.SafePath.isCleanPath('foo/bar/*') return result.should.equal(false) }) it('should not accept a path that contains an asterisk in the 0th element', function () { const result = this.SafePath.isCleanPath('f*o/bar/baz') return result.should.equal(false) }) it('should not accept a path that contains an asterisk in a middle element', function () { const result = this.SafePath.isCleanPath('foo/b*r/baz') return result.should.equal(false) }) it('should not accept a path that contains an asterisk in the filename', function () { const result = this.SafePath.isCleanPath('foo/bar/b*z') return result.should.equal(false) }) it('should not accept multiple problematic elements', function () { const result = this.SafePath.isCleanPath('f*o/b*r/b*z') return result.should.equal(false) }) it('should not accept a problematic path with an empty element', function () { const result = this.SafePath.isCleanPath('foo//*/bar') return result.should.equal(false) }) it('should not accept javascript property names', function () { const result = this.SafePath.isCleanPath('prototype') return result.should.equal(false) }) it('should not accept javascript property names in the prototype', function () { const result = this.SafePath.isCleanPath('hasOwnProperty') return result.should.equal(false) }) it('should not accept javascript property names resulting from substitutions', function () { const result = this.SafePath.isCleanPath(' proto ') return result.should.equal(false) }) }) describe('isAllowedLength', function () { it('should accept a valid path "main.tex"', function () { const result = this.SafePath.isAllowedLength('main.tex') return result.should.equal(true) }) it('should not accept an extremely long path', function () { const longPath = new Array(1000).join('/subdir') + '/main.tex' const result = this.SafePath.isAllowedLength(longPath) return result.should.equal(false) }) it('should not accept an empty path', function () { const result = this.SafePath.isAllowedLength('') return result.should.equal(false) }) }) describe('clean', function () { it('should not modify a valid filename', function () { const result = this.SafePath.clean('main.tex') return result.should.equal('main.tex') }) it('should replace invalid characters with _', function () { const result = this.SafePath.clean('foo/bar*/main.tex') return result.should.equal('foo_bar__main.tex') }) it('should replace "." with "_"', function () { const result = this.SafePath.clean('.') return result.should.equal('_') }) it('should replace ".." with "__"', function () { const result = this.SafePath.clean('..') return result.should.equal('__') }) it('should replace a single trailing space with _', function () { const result = this.SafePath.clean('foo ') return result.should.equal('foo_') }) it('should replace a multiple trailing spaces with ___', function () { const result = this.SafePath.clean('foo ') return result.should.equal('foo__') }) it('should replace a single leading space with _', function () { const result = this.SafePath.clean(' foo') return result.should.equal('_foo') }) it('should replace a multiple leading spaces with ___', function () { const result = this.SafePath.clean(' foo') return result.should.equal('__foo') }) it('should prefix javascript property names with @', function () { const result = this.SafePath.clean('prototype') return result.should.equal('@prototype') }) it('should prefix javascript property names in the prototype with @', function () { const result = this.SafePath.clean('hasOwnProperty') return result.should.equal('@hasOwnProperty') }) }) })
overleaf/web/test/unit/src/Project/SafePathTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Project/SafePathTests.js", "repo_id": "overleaf", "token_count": 3421 }
580
const SandboxedModule = require('sandboxed-module') const sinon = require('sinon') const modulePath = require('path').join( __dirname, '../../../../app/src/Features/Spelling/SpellingController.js' ) const TEN_SECONDS = 1000 * 10 const SPELLING_HOST = 'http://spelling.service.test' const SPELLING_URL = 'http://spelling.service.test' describe('SpellingController', function () { const userId = '123nd3ijdks' beforeEach(function () { this.requestStreamPipe = sinon.stub() this.requestStreamOn = sinon .stub() .returns({ pipe: this.requestStreamPipe }) this.request = sinon.stub().returns({ on: this.requestStreamOn, }) this.AuthenticationController = { getLoggedInUserId: req => req.session.user._id, } this.controller = SandboxedModule.require(modulePath, { requires: { request: this.request, '@overleaf/settings': { languages: [ { name: 'English', code: 'en' }, { name: 'French', code: 'fr' }, ], apis: { spelling: { host: SPELLING_HOST, url: SPELLING_URL } }, }, '../Authentication/AuthenticationController': this .AuthenticationController, }, }) this.req = { url: '/spelling/check', method: 'POST', params: {}, session: { user: { _id: userId, }, }, headers: { Host: SPELLING_HOST }, } this.res = {} this.res.send = sinon.stub() this.res.status = sinon.stub().returns(this.res) this.res.end = sinon.stub() this.res.json = sinon.stub() }) describe('proxyRequestToSpellingApi', function () { describe('on successful call', function () { beforeEach(function () { this.req.session.user._id = this.userId = 'user-id-123' this.req.body = { language: 'en', words: ['blab'] } this.controller.proxyRequestToSpellingApi(this.req, this.res) }) it('should send a request to the spelling host', function () { this.request .calledWith({ url: `${SPELLING_URL}/user/${this.userId}/check`, method: this.req.method, headers: this.req.headers, json: this.req.body, timeout: TEN_SECONDS, }) .should.equal(true) }) it('should stream the response to the request', function () { this.requestStreamPipe.calledWith(this.res).should.equal(true) }) it('should add an error callback to the request', function () { this.requestStreamOn.calledWith('error').should.equal(true) }) }) describe('when the requested language is not supported', function () { beforeEach(function () { this.req.session.user._id = this.userId = 'user-id-123' this.req.body = { language: 'fi', words: ['blab'] } }) describe('when the request is a check request', function () { beforeEach(function () { this.controller.proxyRequestToSpellingApi(this.req, this.res) }) it('should not send a request to the spelling host', function () { this.request.called.should.equal(false) }) it('should return an empty misspellings array', function () { this.res.send .calledWith(JSON.stringify({ misspellings: [] })) .should.equal(true) }) it('should return a 422 status', function () { this.res.status.calledWith(422).should.equal(true) }) }) describe('when the request is not a check request', function () { beforeEach(function () { this.req.url = '/spelling/learn' this.controller.proxyRequestToSpellingApi(this.req, this.res) }) it('should send a request to the spelling host', function () { this.request.called.should.equal(true) }) }) }) describe('when no language is indicated', function () { beforeEach(function () { this.req.session.user._id = this.userId = 'user-id-123' this.req.body = { words: ['blab'] } }) describe('when the request is a check request', function () { beforeEach(function () { this.controller.proxyRequestToSpellingApi(this.req, this.res) }) it('should not send a request to the spelling host', function () { this.request.called.should.equal(false) }) it('should return an empty misspellings array', function () { this.res.send .calledWith(JSON.stringify({ misspellings: [] })) .should.equal(true) }) it('should return a 422 status', function () { this.res.status.calledWith(422).should.equal(true) }) }) describe('when the request is not a check request', function () { beforeEach(function () { this.req.url = '/spelling/learn' this.controller.proxyRequestToSpellingApi(this.req, this.res) }) it('should send a request to the spelling host', function () { this.request.called.should.equal(true) }) }) }) }) })
overleaf/web/test/unit/src/Spelling/SpellingControllerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Spelling/SpellingControllerTests.js", "repo_id": "overleaf", "token_count": 2209 }
581
const SandboxedModule = require('sandboxed-module') const { expect } = require('chai') const sinon = require('sinon') const modulePath = '../../../../app/src/Features/Subscription/UserFeaturesUpdater' describe('UserFeaturesUpdater', function () { beforeEach(function () { this.User = { updateOne: sinon.stub().callsArgWith(2) } this.UserFeaturesUpdater = SandboxedModule.require(modulePath, { requires: { '../../models/User': { User: this.User, }, }, }) }) describe('updateFeatures', function () { it('should send the users features', function (done) { const userId = '5208dd34438842e2db000005' this.features = { versioning: true, collaborators: 10 } this.UserFeaturesUpdater.updateFeatures( userId, this.features, (err, features) => { const update = { 'features.versioning': true, 'features.collaborators': 10, } const updateArgs = this.User.updateOne.lastCall.args expect(updateArgs[0]).to.deep.equal({ _id: userId }) expect(Object.keys(updateArgs[1]).length).to.equal(3) expect(updateArgs[1]['features.versioning']).to.equal( update['features.versioning'] ) expect(updateArgs[1]['features.collaborators']).to.equal( update['features.collaborators'] ) expect(updateArgs[1].featuresUpdatedAt instanceof Date).to.be.true features.should.deep.equal(this.features) done() } ) }) }) describe('overrideFeatures', function () { it('should send the users features', function (done) { const userId = '5208dd34438842e2db000005' this.features = { versioning: true, collaborators: 10 } this.UserFeaturesUpdater.updateFeatures( userId, this.features, (err, features) => { const update = { 'features.versioning': true, 'features.collaborators': 10, } const updateArgs = this.User.updateOne.lastCall.args expect(updateArgs[0]).to.deep.equal({ _id: userId }) expect(Object.keys(updateArgs[1]).length).to.equal(3) expect(updateArgs[1]['features.versioning']).to.equal( update['features.versioning'] ) expect(updateArgs[1]['features.collaborators']).to.equal( update['features.collaborators'] ) expect(updateArgs[1].featuresUpdatedAt instanceof Date).to.be.true features.should.deep.equal(this.features) done() } ) }) }) })
overleaf/web/test/unit/src/Subscription/UserFeaturesUpdaterTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Subscription/UserFeaturesUpdaterTests.js", "repo_id": "overleaf", "token_count": 1160 }
582
/* 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 * DS206: Consider reworking classes to avoid initClass * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const sinon = require('sinon') const { expect } = require('chai') const modulePath = '../../../../app/src/Features/Uploads/ProjectUploadController.js' const SandboxedModule = require('sandboxed-module') const MockRequest = require('../helpers/MockRequest') const MockResponse = require('../helpers/MockResponse') const ArchiveErrors = require('../../../../app/src/Features/Uploads/ArchiveErrors') describe('ProjectUploadController', function () { beforeEach(function () { let Timer this.req = new MockRequest() this.res = new MockResponse() this.user_id = 'user-id-123' this.metrics = { Timer: (Timer = (function () { Timer = class Timer { static initClass() { this.prototype.done = sinon.stub() } } Timer.initClass() return Timer })()), } this.SessionManager = { getLoggedInUserId: sinon.stub().returns(this.user_id), } return (this.ProjectUploadController = SandboxedModule.require(modulePath, { requires: { multer: sinon.stub(), '@overleaf/settings': { path: {} }, './ProjectUploadManager': (this.ProjectUploadManager = {}), './FileSystemImportManager': (this.FileSystemImportManager = {}), '@overleaf/metrics': this.metrics, '../Authentication/SessionManager': this.SessionManager, './ArchiveErrors': ArchiveErrors, fs: (this.fs = {}), }, })) }) describe('uploadProject', function () { beforeEach(function () { this.path = '/path/to/file/on/disk.zip' this.name = 'filename.zip' this.req.file = { path: this.path, originalname: this.name, } this.req.session = { user: { _id: this.user_id, }, } this.project = { _id: (this.project_id = 'project-id-123') } return (this.fs.unlink = sinon.stub()) }) describe('successfully', function () { beforeEach(function () { this.ProjectUploadManager.createProjectFromZipArchive = sinon .stub() .callsArgWith(3, null, this.project) return this.ProjectUploadController.uploadProject(this.req, this.res) }) it('should create a project owned by the logged in user', function () { return this.ProjectUploadManager.createProjectFromZipArchive .calledWith(this.user_id) .should.equal(true) }) it('should create a project with the same name as the zip archive', function () { return this.ProjectUploadManager.createProjectFromZipArchive .calledWith(sinon.match.any, 'filename', sinon.match.any) .should.equal(true) }) it('should create a project from the zip archive', function () { return this.ProjectUploadManager.createProjectFromZipArchive .calledWith(sinon.match.any, sinon.match.any, this.path) .should.equal(true) }) it('should return a successful response to the FileUploader client', function () { return expect(this.res.body).to.deep.equal({ success: true, project_id: this.project_id, }) }) it('should record the time taken to do the upload', function () { return this.metrics.Timer.prototype.done.called.should.equal(true) }) it('should remove the uploaded file', function () { return this.fs.unlink.calledWith(this.path).should.equal(true) }) }) describe('when ProjectUploadManager.createProjectFromZipArchive fails', function () { beforeEach(function () { this.ProjectUploadManager.createProjectFromZipArchive = sinon .stub() .callsArgWith(3, new Error('Something went wrong'), this.project) return this.ProjectUploadController.uploadProject(this.req, this.res) }) it('should return a failed response to the FileUploader client', function () { return expect(this.res.body).to.deep.equal( JSON.stringify({ success: false, error: 'upload_failed' }) ) }) }) describe('when ProjectUploadManager.createProjectFromZipArchive reports the file as invalid', function () { beforeEach(function () { this.ProjectUploadManager.createProjectFromZipArchive = sinon .stub() .callsArgWith( 3, new ArchiveErrors.ZipContentsTooLargeError(), this.project ) return this.ProjectUploadController.uploadProject(this.req, this.res) }) it('should return the reported error to the FileUploader client', function () { expect(JSON.parse(this.res.body)).to.deep.equal({ success: false, error: 'zip_contents_too_large', }) }) it("should return an 'unprocessable entity' status code", function () { return expect(this.res.statusCode).to.equal(422) }) }) }) describe('uploadFile', function () { beforeEach(function () { this.project_id = 'project-id-123' this.folder_id = 'folder-id-123' this.path = '/path/to/file/on/disk.png' this.name = 'filename.png' this.req.file = { path: this.path, originalname: this.name, } this.req.session = { user: { _id: this.user_id, }, } this.req.params = { Project_id: this.project_id } this.req.query = { folder_id: this.folder_id } return (this.fs.unlink = sinon.stub()) }) describe('successfully', function () { beforeEach(function () { this.entity = { _id: '1234', type: 'file', } this.FileSystemImportManager.addEntity = sinon .stub() .callsArgWith(6, null, this.entity) return this.ProjectUploadController.uploadFile(this.req, this.res) }) it('should insert the file', function () { return this.FileSystemImportManager.addEntity .calledWith( this.user_id, this.project_id, this.folder_id, this.name, this.path ) .should.equal(true) }) it('should return a successful response to the FileUploader client', function () { return expect(this.res.body).to.deep.equal({ success: true, entity_id: this.entity._id, entity_type: 'file', }) }) it('should time the request', function () { return this.metrics.Timer.prototype.done.called.should.equal(true) }) it('should remove the uploaded file', function () { return this.fs.unlink.calledWith(this.path).should.equal(true) }) }) describe('when FileSystemImportManager.addEntity returns a generic error', function () { beforeEach(function () { this.FileSystemImportManager.addEntity = sinon .stub() .callsArgWith(6, new Error('Sorry something went wrong')) return this.ProjectUploadController.uploadFile(this.req, this.res) }) it('should return an unsuccessful response to the FileUploader client', function () { return expect(this.res.body).to.deep.equal({ success: false, }) }) }) describe('when FileSystemImportManager.addEntity returns a too many files error', function () { beforeEach(function () { this.FileSystemImportManager.addEntity = sinon .stub() .callsArgWith(6, new Error('project_has_too_many_files')) return this.ProjectUploadController.uploadFile(this.req, this.res) }) it('should return an unsuccessful response to the FileUploader client', function () { return expect(this.res.body).to.deep.equal({ success: false, error: 'project_has_too_many_files', }) }) }) describe('with an invalid filename', function () { beforeEach(function () { this.req.file.originalname = '' return this.ProjectUploadController.uploadFile(this.req, this.res) }) it('should return a a non success response', function () { return expect(this.res.body).to.deep.equal({ success: false, error: 'invalid_filename', }) }) }) }) })
overleaf/web/test/unit/src/Uploads/ProjectUploadControllerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/Uploads/ProjectUploadControllerTests.js", "repo_id": "overleaf", "token_count": 3584 }
583
/* 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 modulePath = path.join( __dirname, '../../../../app/src/Features/User/UserRegistrationHandler' ) const sinon = require('sinon') const { expect } = require('chai') const EmailHelper = require('../../../../app/src/Features/Helpers/EmailHelper') describe('UserRegistrationHandler', function () { beforeEach(function () { this.user = { _id: (this.user_id = '31j2lk21kjl') } this.User = { updateOne: sinon.stub().callsArgWith(2) } this.UserGetter = { getUserByAnyEmail: sinon.stub() } this.UserCreator = { createNewUser: sinon.stub().callsArgWith(2, null, this.user), } this.AuthenticationManager = { validateEmail: sinon.stub().returns(null), validatePassword: sinon.stub().returns(null), setUserPassword: sinon.stub().callsArgWith(2), } this.NewsLetterManager = { subscribe: sinon.stub().callsArgWith(1) } this.EmailHandler = { sendEmail: sinon.stub().callsArgWith(2) } this.OneTimeTokenHandler = { getNewToken: sinon.stub() } this.handler = SandboxedModule.require(modulePath, { requires: { '../../models/User': { User: this.User }, './UserGetter': this.UserGetter, './UserCreator': this.UserCreator, '../Authentication/AuthenticationManager': this.AuthenticationManager, '../Newsletter/NewsletterManager': this.NewsLetterManager, crypto: (this.crypto = {}), '../Email/EmailHandler': this.EmailHandler, '../Security/OneTimeTokenHandler': this.OneTimeTokenHandler, '../Analytics/AnalyticsManager': (this.AnalyticsManager = { recordEvent: sinon.stub(), }), '@overleaf/settings': (this.settings = { siteUrl: 'http://sl.example.com', }), '../Helpers/EmailHelper': EmailHelper, }, }) return (this.passingRequest = { email: 'something@email.com', password: '123', }) }) describe('validate Register Request', function () { it('allows passing validation through', function () { const result = this.handler._registrationRequestIsValid( this.passingRequest ) return result.should.equal(true) }) describe('failing email validation', function () { beforeEach(function () { return this.AuthenticationManager.validateEmail.returns({ message: 'email not set', }) }) it('does not allow through', function () { const result = this.handler._registrationRequestIsValid( this.passingRequest ) return result.should.equal(false) }) }) describe('failing password validation', function () { beforeEach(function () { return this.AuthenticationManager.validatePassword.returns({ message: 'password is too short', }) }) it('does not allow through', function () { const result = this.handler._registrationRequestIsValid( this.passingRequest ) return result.should.equal(false) }) }) }) describe('registerNewUser', function () { describe('holdingAccount', function (done) { beforeEach(function () { this.user.holdingAccount = true this.handler._registrationRequestIsValid = sinon.stub().returns(true) return this.UserGetter.getUserByAnyEmail.callsArgWith( 1, null, this.user ) }) it('should not create a new user if there is a holding account there', function (done) { return this.handler.registerNewUser(this.passingRequest, err => { this.UserCreator.createNewUser.called.should.equal(false) return done() }) }) it('should set holding account to false', function (done) { return this.handler.registerNewUser(this.passingRequest, err => { const update = this.User.updateOne.args[0] assert.deepEqual(update[0], { _id: this.user._id }) assert.deepEqual(update[1], { $set: { holdingAccount: false } }) return done() }) }) }) describe('invalidRequest', function () { it('should not create a new user if the the request is not valid', function (done) { this.handler._registrationRequestIsValid = sinon.stub().returns(false) return this.handler.registerNewUser(this.passingRequest, err => { expect(err).to.exist this.UserCreator.createNewUser.called.should.equal(false) return done() }) }) it('should return email registered in the error if there is a non holdingAccount there', function (done) { this.UserGetter.getUserByAnyEmail.callsArgWith( 1, null, (this.user = { holdingAccount: false }) ) return this.handler.registerNewUser( this.passingRequest, (err, user) => { expect(err).to.be.instanceOf(Error) expect(err).to.have.property('message', 'EmailAlreadyRegistered') user.should.deep.equal(this.user) return done() } ) }) }) describe('validRequest', function () { beforeEach(function () { this.handler._registrationRequestIsValid = sinon.stub().returns(true) return this.UserGetter.getUserByAnyEmail.callsArgWith(1) }) it('should create a new user', function (done) { return this.handler.registerNewUser(this.passingRequest, err => { this.UserCreator.createNewUser .calledWith({ email: this.passingRequest.email, holdingAccount: false, first_name: this.passingRequest.first_name, last_name: this.passingRequest.last_name, }) .should.equal(true) return done() }) }) it('lower case email', function (done) { this.passingRequest.email = 'soMe@eMail.cOm' return this.handler.registerNewUser(this.passingRequest, err => { this.UserCreator.createNewUser.args[0][0].email.should.equal( 'some@email.com' ) return done() }) }) it('trim white space from email', function (done) { this.passingRequest.email = ' some@email.com ' return this.handler.registerNewUser(this.passingRequest, err => { this.UserCreator.createNewUser.args[0][0].email.should.equal( 'some@email.com' ) return done() }) }) it('should set the password', function (done) { return this.handler.registerNewUser(this.passingRequest, err => { this.AuthenticationManager.setUserPassword .calledWith(this.user, this.passingRequest.password) .should.equal(true) return done() }) }) it('should add the user to the newsletter if accepted terms', function (done) { this.passingRequest.subscribeToNewsletter = 'true' return this.handler.registerNewUser(this.passingRequest, err => { this.NewsLetterManager.subscribe .calledWith(this.user) .should.equal(true) return done() }) }) it('should not add the user to the newsletter if not accepted terms', function (done) { return this.handler.registerNewUser(this.passingRequest, err => { this.NewsLetterManager.subscribe .calledWith(this.user) .should.equal(false) return done() }) }) it('should track the registration event', function (done) { return this.handler.registerNewUser(this.passingRequest, err => { this.AnalyticsManager.recordEvent .calledWith(this.user._id, 'user-registered') .should.equal(true) return done() }) }) }) it('should call the ReferalAllocator', function (done) { return done() }) }) describe('registerNewUserAndSendActivationEmail', function () { beforeEach(function () { this.email = 'Email@example.com' this.crypto.randomBytes = sinon.stub().returns({ toString: () => { return (this.password = 'mock-password') }, }) this.OneTimeTokenHandler.getNewToken.yields( null, (this.token = 'mock-token') ) this.handler.registerNewUser = sinon.stub() return (this.callback = sinon.stub()) }) describe('with a new user', function () { beforeEach(function () { this.user.email = this.email.toLowerCase() this.handler.registerNewUser.callsArgWith(1, null, this.user) return this.handler.registerNewUserAndSendActivationEmail( this.email, this.callback ) }) it('should ask the UserRegistrationHandler to register user', function () { return this.handler.registerNewUser .calledWith({ email: this.email, password: this.password, }) .should.equal(true) }) it('should generate a new password reset token', function () { const data = { user_id: this.user._id.toString(), email: this.user.email, } return this.OneTimeTokenHandler.getNewToken .calledWith('password', data, { expiresIn: 7 * 24 * 60 * 60 }) .should.equal(true) }) it('should send a registered email', function () { return this.EmailHandler.sendEmail .calledWith('registered', { to: this.user.email, setNewPasswordUrl: `${this.settings.siteUrl}/user/activate?token=${this.token}&user_id=${this.user_id}`, }) .should.equal(true) }) it('should return the user', function () { return this.callback .calledWith( null, this.user, `${this.settings.siteUrl}/user/activate?token=${this.token}&user_id=${this.user_id}` ) .should.equal(true) }) }) describe('with a user that already exists', function () { beforeEach(function () { this.handler.registerNewUser.callsArgWith( 1, new Error('EmailAlreadyRegistered'), this.user ) return this.handler.registerNewUserAndSendActivationEmail( this.email, this.callback ) }) it('should still generate a new password token and email', function () { this.OneTimeTokenHandler.getNewToken.called.should.equal(true) return this.EmailHandler.sendEmail.called.should.equal(true) }) }) }) })
overleaf/web/test/unit/src/User/UserRegistrationHandlerTests.js/0
{ "file_path": "overleaf/web/test/unit/src/User/UserRegistrationHandlerTests.js", "repo_id": "overleaf", "token_count": 4716 }
584
const mockModel = require('../MockModel') module.exports = mockModel('Folder', { './Doc': require('./Doc'), './File': require('./File'), })
overleaf/web/test/unit/src/helpers/models/Folder.js/0
{ "file_path": "overleaf/web/test/unit/src/helpers/models/Folder.js", "repo_id": "overleaf", "token_count": 51 }
585
# run tranformer npx jscodeshift \ -t transform/o-error/transform.js \ --ignore-pattern=frontend/js/libraries.js \ --ignore-pattern=frontend/js/vendor \ $1 # replace blank lines in staged changed with token git diff --ignore-all-space --ignore-blank-lines | sed 's/^\+$/\+REMOVE_ME_IM_A_BLANK_LINE/g' | git apply --reject --cached --ignore-space-change # stage changes with token instead of blank line git checkout . git add -A # delete line containing token in staged files git diff --cached --name-only | xargs sed -i '/^REMOVE_ME_IM_A_BLANK_LINE$/d' # fix format on modified files make format_fix
overleaf/web/transform/o-error/transform.sh/0
{ "file_path": "overleaf/web/transform/o-error/transform.sh", "repo_id": "overleaf", "token_count": 209 }
586
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["github>owncloud-ops/renovate-presets:docker"], "prConcurrentLimit": 5, "ignoreDeps": ["@adobe/leonardo-contrast-colors"] }
owncloud/web/.renovaterc.json/0
{ "file_path": "owncloud/web/.renovaterc.json", "repo_id": "owncloud", "token_count": 84 }
587
Enhancement: Use TUS settings from capabilities The TUS settings advertise the maximum chunk size, so we now use the smallest chunk size from the one configured in config.json and the one from the capabilities. If the capabilities report that one should use the X-HTTP-Override-Method header, the upload will now use a POST request for uploads with that header set instead of PATCH. https://github.com/owncloud/ocis-reva/issues/177 https://github.com/owncloud/web/pull/3568
owncloud/web/changelog/0.11.0_2020-06-26/3568/0
{ "file_path": "owncloud/web/changelog/0.11.0_2020-06-26/3568", "repo_id": "owncloud", "token_count": 125 }
588
Change: Use correct logo We've changed the ownCloud logo which is used in the default theme. The previous logo had an incorrect font-weight. https://github.com/owncloud/owncloud-design-system/issues/786 https://github.com/owncloud/web/pull/3604
owncloud/web/changelog/0.11.0_2020-06-26/use-correct-logo/0
{ "file_path": "owncloud/web/changelog/0.11.0_2020-06-26/use-correct-logo", "repo_id": "owncloud", "token_count": 70 }
589
Change: Differentiate between user-id and username With oCIS user-id and username are not the same as is the case in ownCloud 10. We've started differentiating between them to correctly display all information in the accounts page. If the username is not available (oC10), we fall back to using user-id as the username. https://github.com/owncloud/ocis/issues/440 https://github.com/owncloud/web/pull/3938
owncloud/web/changelog/0.14.0_2020-08-17/differentiate-between-id-and-username/0
{ "file_path": "owncloud/web/changelog/0.14.0_2020-08-17/differentiate-between-id-and-username", "repo_id": "owncloud", "token_count": 109 }
590
Change: Add default action to click on file name When clicking on the file name in the files list, a default action is triggered which opens the first available file editor or viewer. If no file editor or viewer is available, the default action falls back to download. https://github.com/owncloud/product/issues/234 https://github.com/owncloud/web/pull/4076 https://github.com/owncloud/web/pull/4097
owncloud/web/changelog/0.17.0_2020-09-25/default-action/0
{ "file_path": "owncloud/web/changelog/0.17.0_2020-09-25/default-action", "repo_id": "owncloud", "token_count": 105 }
591
Change: Enable autoredirect to the IdP We've added a key into the theme to enable autoredirect to the IdP when entering ocis-web instead of displaying the login page first. The default value is set to true. https://github.com/owncloud/web/pull/4138
owncloud/web/changelog/0.20.0_2020-10-08/login-autoredirect/0
{ "file_path": "owncloud/web/changelog/0.20.0_2020-10-08/login-autoredirect", "repo_id": "owncloud", "token_count": 71 }
592
Bugfix: Fix edit public link view We've fixed the issue that edit public link view in the sidebar was overlapping with the versions accordion. https://github.com/owncloud/web/pull/4374
owncloud/web/changelog/0.26.0_2020-11-23/fix-edit-link-view/0
{ "file_path": "owncloud/web/changelog/0.26.0_2020-11-23/fix-edit-link-view", "repo_id": "owncloud", "token_count": 49 }
593
Enhancement: Add share indicator for direct and indirect shares in file list We've added the ability for the user to directly see whether a resource is shared in the file list. For this, share indicators in the form of a group icon and link icon will appear in a new column near the shared resource. The blue color of an icon tells whether outgoing shares exist directly on the resource. The grey color of an icon tells that incoming or outgoing shares exist on any of the parent folders. https://github.com/owncloud/web/issues/2060 https://github.com/owncloud/web/issues/2894 https://github.com/owncloud/web/pull/2877
owncloud/web/changelog/0.3.0_2020-01-31/2877/0
{ "file_path": "owncloud/web/changelog/0.3.0_2020-01-31/2877", "repo_id": "owncloud", "token_count": 153 }
594
Change: Improve ownCloud Design System (ODS) During the work on this release, there have been several changes in ODS which directly affect Web. - Proper text truncate in breadcrumb component. This fixes the mobile view of the current folder breadcrumb in the top bar. - New icon sizes `xlarge` and `xxlarge` in oc-icon component. Those are used for the `No content` messages e.g. when navigating to an empty folder. - Provide new icon size `xsmall` and align spinner-sizes with icon-sizes. The `xsmall` icon size turned out to be prettier in some places. The size alignments fixed layout glitches when removing collaborators or public links. - Fix aria label on spinner in oc-autocomplete. Warning were cluttering the JavaScript console when adding collaborators. - Reset input on selection in oc-autocomplete, when `fillOnSelection=false`. This makes sure that when a new collaborator has been selected, the search input field goes back to being blank for a new search. https://github.com/owncloud/web/issues/2989 https://github.com/owncloud/owncloud-design-system/pull/630 https://github.com/owncloud/owncloud-design-system/pull/632 https://github.com/owncloud/owncloud-design-system/pull/633 https://github.com/owncloud/owncloud-design-system/pull/634 https://github.com/owncloud/owncloud-design-system/pull/635
owncloud/web/changelog/0.4.0_2020-02-14/2989/0
{ "file_path": "owncloud/web/changelog/0.4.0_2020-02-14/2989", "repo_id": "owncloud", "token_count": 356 }
595
Bugfix: Indirect share info now visible in favorite and other file lists When open the share panel of other flat file lists like the favorites, the collaborators list and link list are now showing the same entries like in the "All files" list, which includes indirect shares (via) that were previously missing. https://github.com/owncloud/web/issues/3040 https://github.com/owncloud/web/pull/3135
owncloud/web/changelog/0.6.0_2020-03-16/3040/0
{ "file_path": "owncloud/web/changelog/0.6.0_2020-03-16/3040", "repo_id": "owncloud", "token_count": 102 }
596
Bugfix: Display errors when saving collaborator fails When saving a collaborator has failed, the UI was still behaving like it saved everything successfully. This has been fixed by displaying the errors at the top of the collaborator editing form and staying in the editing view. https://github.com/owncloud/web/issues/3176 https://github.com/owncloud/web/pull/3241
owncloud/web/changelog/0.8.0_2020-04-14/3176/0
{ "file_path": "owncloud/web/changelog/0.8.0_2020-04-14/3176", "repo_id": "owncloud", "token_count": 87 }
597
Enhancement: Extend default apps When release tarballs are created, we are copying the config.json.dist into them as a default config. In that file were so far only "files" app enabled. This adds also "media viewer" and "draw-io" into apps enabled by default. https://github.com/owncloud/web/pull/4493
owncloud/web/changelog/1.0.0_2020-12-16/default-apps/0
{ "file_path": "owncloud/web/changelog/1.0.0_2020-12-16/default-apps", "repo_id": "owncloud", "token_count": 83 }
598
Bugfix: Allow server URL without trailing slash The server URL in the config was leading to issues resolving resources when it had no trailing slash. We are now checking if the trailing slash is missing and add it upon applying the config if needed. https://github.com/owncloud/web/pull/4536
owncloud/web/changelog/1.0.1_2021-01-08/server-url/0
{ "file_path": "owncloud/web/changelog/1.0.1_2021-01-08/server-url", "repo_id": "owncloud", "token_count": 68 }
599
Bugfix: Parent paths traversal for shares We fixed a bug in parent paths traversals for loading shares. A path with a trailing slash was twice in the result of (parent-)paths, leading to fetching the existing shares on the current folder twice. Since we fetch incoming and outgoing shares this caused 2 unnecessary requests on every page load that changed into a child folder or a folder unrelated to the current path. https://github.com/owncloud/web/issues/4860 https://github.com/owncloud/web/pull/4918
owncloud/web/changelog/3.0.0_2021-04-21/bugfix-parent-paths/0
{ "file_path": "owncloud/web/changelog/3.0.0_2021-04-21/bugfix-parent-paths", "repo_id": "owncloud", "token_count": 120 }
600
Enhancement: Implement proper direct delete We implemented a proper delete action for a single file instead of reusing the batch action for deleting multiple files. This also solves the issue with the checkbox being checked when opening the delete modal, which was not a11y compliant. https://github.com/owncloud/web/pull/4991
owncloud/web/changelog/3.1.0_2021-05-12/enhancement-direct-delete/0
{ "file_path": "owncloud/web/changelog/3.1.0_2021-05-12/enhancement-direct-delete", "repo_id": "owncloud", "token_count": 77 }
601
Bugfix: Center MediaViewer loading spinner The loading spinner in the media viewer app wasn't centered vertically since the wrapping element was to small. It has now been given a min-height of the current screen size. https://github.com/owncloud/web/pull/5270 https://github.com/owncloud/web/issues/5196
owncloud/web/changelog/3.3.0_2021-06-23/bugfix-center-mediaviewer-loadingspinner/0
{ "file_path": "owncloud/web/changelog/3.3.0_2021-06-23/bugfix-center-mediaviewer-loadingspinner", "repo_id": "owncloud", "token_count": 87 }
602
Bugfix: Upsert resource in filestable When uploading an already existing resource in the filestable, we sometimes displayed both files in the filestable until the page got refreshed. We now check when uploading a file if it exists in the filestable and replace it there if that is the case. https://github.com/owncloud/web/pull/5130
owncloud/web/changelog/3.3.0_2021-06-23/bugfix-upsert-resource-in-filestable/0
{ "file_path": "owncloud/web/changelog/3.3.0_2021-06-23/bugfix-upsert-resource-in-filestable", "repo_id": "owncloud", "token_count": 87 }
603
Enhancement: Do not reset file selection when cancelling batch delete We've removed the reset selection method call when cancelling batch delete. If the user now cancels the delete dialog, the file selection stays as it was before displaying the dialog. https://github.com/owncloud/web/pull/5107
owncloud/web/changelog/3.3.0_2021-06-23/enhancement-modal-selection-reset/0
{ "file_path": "owncloud/web/changelog/3.3.0_2021-06-23/enhancement-modal-selection-reset", "repo_id": "owncloud", "token_count": 70 }
604
Enhancement: Visibility observer By adding a visibility observer, we now only load image previews for those files that are close to the user's viewport. It is also equipped with a short waiting period so scrolling doesn't lead to an overload of requests. https://github.com/owncloud/web/pull/5194
owncloud/web/changelog/3.3.0_2021-06-23/enhancement-visibility-observer/0
{ "file_path": "owncloud/web/changelog/3.3.0_2021-06-23/enhancement-visibility-observer", "repo_id": "owncloud", "token_count": 75 }
605
Bugfix: Unnecessary quota requests We've removed requests that checked for a user's quota on pages where it was not relevant. https://github.com/owncloud/web/pull/5539
owncloud/web/changelog/4.0.0_2021-08-04/bugfix-unnecessary-quota-requests/0
{ "file_path": "owncloud/web/changelog/4.0.0_2021-08-04/bugfix-unnecessary-quota-requests", "repo_id": "owncloud", "token_count": 46 }
606
Enhancement: Move file via drag and drop We've added moving files and folders via drag and drop to the files table view. https://github.com/owncloud/web/issues/5592 https://github.com/owncloud/web/pull/5588
owncloud/web/changelog/4.1.0_2021-08-20/enhancement-move-file-drag-drop/0
{ "file_path": "owncloud/web/changelog/4.1.0_2021-08-20/enhancement-move-file-drag-drop", "repo_id": "owncloud", "token_count": 62 }
607
Enhancement: Early store initialization We made sure that the store and auth get initialized as early as possible. With this we ensured that capabilities are always loaded as soon as applications start their initialization process. https://github.com/owncloud/web/pull/5874
owncloud/web/changelog/4.3.0_2021-10-07/enhancement-early-store-init/0
{ "file_path": "owncloud/web/changelog/4.3.0_2021-10-07/enhancement-early-store-init", "repo_id": "owncloud", "token_count": 60 }
608
Bugfix: Fix location picker breadcrumb url encoding The breadcrumb urls in location-picker were encoded. We've fixed this by removing the encoding. https://github.com/owncloud/web/pull/5940 https://github.com/owncloud/web/pull/5715 https://github.com/owncloud/web/issues/5938
owncloud/web/changelog/4.5.0_2021-11-16/bugfix-breadcrumb-path-encoding/0
{ "file_path": "owncloud/web/changelog/4.5.0_2021-11-16/bugfix-breadcrumb-path-encoding", "repo_id": "owncloud", "token_count": 88 }
609
Enhancement: Update ODS to v11.3.1 We updated the ownCloud Design System to version 11.3.1. Please refer to the full changelog in the ODS release (linked) for more details. Summary: - Bugfix - Set language for date formatting: https://github.com/owncloud/owncloud-design-system/pull/1806 - Enhancement - Relative date tooltips in the OcTableFiles component: https://github.com/owncloud/owncloud-design-system/pull/1787 - Enhancement - Breadcrumb contextmenu: https://github.com/owncloud/web/issues/6030 - Enhancement - Optional padding size for OcDrop: https://github.com/owncloud/owncloud-design-system/pull/1798 - Enhancement - Truncate file names while preserving file extensions: https://github.com/owncloud/owncloud-design-system/issues/1758 https://github.com/owncloud/web/pull/6090 https://github.com/owncloud/owncloud-design-system/releases/tag/v11.3.0 https://github.com/owncloud/owncloud-design-system/releases/tag/v11.3.1
owncloud/web/changelog/4.6.0_2021-12-07/enhancement-update-ods/0
{ "file_path": "owncloud/web/changelog/4.6.0_2021-12-07/enhancement-update-ods", "repo_id": "owncloud", "token_count": 286 }
610
Enhancement: Show errors when failing to open app in app provider The error message provided by wopi is now displayed to the user, giving some context on why it failed to open a file. https://github.com/owncloud/web/pull/6003
owncloud/web/changelog/4.7.0_2021-12-16/enhancement-app-provider-feedback/0
{ "file_path": "owncloud/web/changelog/4.7.0_2021-12-16/enhancement-app-provider-feedback", "repo_id": "owncloud", "token_count": 61 }
611
Bugfix: Breadcrumbs in different views The files app had the breadcrumbs broken in the various views. We fixed that by actively watching the current route now for updates of some active route helpers. https://github.com/owncloud/web/issues/6326 https://github.com/owncloud/web/pull/6370
owncloud/web/changelog/5.0.0_2022-02-14/bugfix-reactive-active-route/0
{ "file_path": "owncloud/web/changelog/5.0.0_2022-02-14/bugfix-reactive-active-route", "repo_id": "owncloud", "token_count": 77 }
612
Enhancement: Resource-specific icons in ResourceTable We've added FontAwesome icons for the different resource types, each getting their respective resource type color from the ODS definition. https://github.com/owncloud/web/pull/6295 https://github.com/owncloud/web/pull/6387
owncloud/web/changelog/5.0.0_2022-02-14/enhancement-fontawesome-icons/0
{ "file_path": "owncloud/web/changelog/5.0.0_2022-02-14/enhancement-fontawesome-icons", "repo_id": "owncloud", "token_count": 74 }
613
Enhancement: Add the graph client to the client service This way, the client for the graph API can easily be fetched when needed. https://github.com/owncloud/web/pull/6425
owncloud/web/changelog/5.1.0_2022-02-18/enhancement-graph-client-service/0
{ "file_path": "owncloud/web/changelog/5.1.0_2022-02-18/enhancement-graph-client-service", "repo_id": "owncloud", "token_count": 49 }
614
Enhancement: Implement the right sidebar for spaces The right sidebar for a space functions similar to the files sidebar and gives the user basic information and actions for the current space. https://github.com/owncloud/web/pull/6437 https://github.com/owncloud/web/issues/6284
owncloud/web/changelog/5.2.0_2022-03-03/enhancement-spaces-sidebar/0
{ "file_path": "owncloud/web/changelog/5.2.0_2022-03-03/enhancement-spaces-sidebar", "repo_id": "owncloud", "token_count": 71 }
615
Enhancement: Don't block account page while groups are loading We don't show a loading state for the full account information page anymore while the group membership information is loading. Instead we only show a loading spinner for the group membership information, while the rest of the user information is available immediately. https://github.com/owncloud/web/pull/6547
owncloud/web/changelog/5.3.0_2022-03-23/enhancement-account-page-loading/0
{ "file_path": "owncloud/web/changelog/5.3.0_2022-03-23/enhancement-account-page-loading", "repo_id": "owncloud", "token_count": 80 }
616
Enhancement: Show space members in share panel for files inside a space The space managers are now displayed in the sidebar for resources within a space. Also, space members are now sorted via role (managers first) and name. https://github.com/owncloud/web/pull/6554 https://github.com/owncloud/web/issues/6283
owncloud/web/changelog/5.3.0_2022-03-23/enhancement-space-members-regular-sidebar/0
{ "file_path": "owncloud/web/changelog/5.3.0_2022-03-23/enhancement-space-members-regular-sidebar", "repo_id": "owncloud", "token_count": 83 }
617
Bugfix: Unsticky appbar position After recent changes to the files appbar, it wouldn't be visible when scrolling inside the table. This has been resolved. https://github.com/owncloud/web/pull/6708 https://github.com/owncloud/web/issues/6696
owncloud/web/changelog/5.4.0_2022-04-11/bugfix-unsticky-appbar-position/0
{ "file_path": "owncloud/web/changelog/5.4.0_2022-04-11/bugfix-unsticky-appbar-position", "repo_id": "owncloud", "token_count": 70 }
618
Enhancement: Spaces context menus Spaces context menus have been adjusted visibly to match the other available context menus. Also, the corresponding component has been abstracted in the course of this. This cleans up a lot of (duplicated) code across the spaces views and makes future adjustments easier. https://github.com/owncloud/web/pull/6659 https://github.com/owncloud/web/issues/6634
owncloud/web/changelog/5.4.0_2022-04-11/enhancement-spaces-context-menus/0
{ "file_path": "owncloud/web/changelog/5.4.0_2022-04-11/enhancement-spaces-context-menus", "repo_id": "owncloud", "token_count": 97 }
619
Bugfix: Indicate guest shares We've fixed a bug, where guest shares were not correctly indicated and shown as users shares at the share panel in the right sidebar. https://github.com/owncloud/web/pull/6813
owncloud/web/changelog/5.5.0_2022-06-20/bugfix-indicate-guest-shares/0
{ "file_path": "owncloud/web/changelog/5.5.0_2022-06-20/bugfix-indicate-guest-shares", "repo_id": "owncloud", "token_count": 55 }
620
Bugfix: Share hint with disabled federated sharing We've removed any occurrences of federated sharing in the hint below the sharing input field if federated sharing is disabled. https://github.com/owncloud/web/issues/5261 https://github.com/owncloud/web/pull/6951
owncloud/web/changelog/5.5.0_2022-06-20/bugfix-share-hint-with-disabled-federation/0
{ "file_path": "owncloud/web/changelog/5.5.0_2022-06-20/bugfix-share-hint-with-disabled-federation", "repo_id": "owncloud", "token_count": 70 }
621
Bugfix: Use OC-ETag instead of ETag in text editor app We've fixed a bug, where the ETag instead of OC-ETag in the text editor app was used, due to server encoding, the ETag might be manipulated and contain the gzip suffix on a large text file. Saving the respective file, might cause an error, as the sent ETag doesn't match the server's ETag. https://github.com/owncloud/web/pull/6952 https://github.com/owncloud/web/issues/6947 https://github.com/owncloud/web/issues/4605
owncloud/web/changelog/5.5.0_2022-06-20/bugfix-use-oc-etag-instead-of-etag-in-text-editor/0
{ "file_path": "owncloud/web/changelog/5.5.0_2022-06-20/bugfix-use-oc-etag-instead-of-etag-in-text-editor", "repo_id": "owncloud", "token_count": 142 }
622
Enhancement: Fixed aspect ratio for spaces images We've set the spaces images to a fixed aspect ratio to make sure that the same part of the image is always displayed. https://github.com/owncloud/web/pull/6829 https://github.com/owncloud/web/issues/6555
owncloud/web/changelog/5.5.0_2022-06-20/enhancement-fixed-aspect-ratio-spaces-image/0
{ "file_path": "owncloud/web/changelog/5.5.0_2022-06-20/enhancement-fixed-aspect-ratio-spaces-image", "repo_id": "owncloud", "token_count": 71 }
623
Enhancement: Add Hotkeys to ResourceTable We've added hotkeys for copy, cut and paste. https://github.com/owncloud/web/pull/7078 https://github.com/owncloud/web/issues/7071
owncloud/web/changelog/5.5.0_2022-06-20/enhancement-resource-table-add-hotkeys/0
{ "file_path": "owncloud/web/changelog/5.5.0_2022-06-20/enhancement-resource-table-add-hotkeys", "repo_id": "owncloud", "token_count": 58 }
624
Enhancement: Wording improvements We've simplified and improved the wording of some copy/move related ui elements. https://github.com/owncloud/web/pull/7125
owncloud/web/changelog/5.5.0_2022-06-20/enhancement-wordings/0
{ "file_path": "owncloud/web/changelog/5.5.0_2022-06-20/enhancement-wordings", "repo_id": "owncloud", "token_count": 44 }
625
Bugfix: File name in text editor We've fixed a bug in the text editor where the UUID of a shared resource was being displayed instead of the file name. https://github.com/owncloud/web/pull/7516 https://github.com/owncloud/web/issues/7292 https://github.com/owncloud/web/pull/7518
owncloud/web/changelog/5.7.0_2022-09-09/bugfix-file-name-in-text-editor/0
{ "file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-file-name-in-text-editor", "repo_id": "owncloud", "token_count": 86 }
626
Bugfix: Missing scroll bar in user management app We've fixed a bug in the user management app where no scroll bar was displayed in the users or groups list if it exceeds the screen size. https://github.com/owncloud/web/pull/7321 https://github.com/owncloud/web/issues/7266
owncloud/web/changelog/5.7.0_2022-09-09/bugfix-missing-scroll-bar-in-user-management-app/0
{ "file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-missing-scroll-bar-in-user-management-app", "repo_id": "owncloud", "token_count": 76 }
627
Bugfix: Search share representation We've fixed a bug, where shares in the search were not displayed correctly and clicking on the respective item did not open the default action or redirect to the correct share route. https://github.com/owncloud/web/pull/7560 https://github.com/owncloud/web/issues/7043
owncloud/web/changelog/5.7.0_2022-09-09/bugfix-search-share-representation/0
{ "file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-search-share-representation", "repo_id": "owncloud", "token_count": 78 }
628
Bugfix: Access token renewal Access token renewals had some flaws which have been fixed as follows: - OAuth2: access token renewal was not working at all, fixed by switching to authorization code flow with PKCE extension and by migrating from the unmaintained `oidc-client` library to `oidc-client-ts`. - OpenID Connect: when `offline_access` scope was not requested each token renewal caused a redirect to `/`, which was due to a faulty token update implementation and is fixed. WARNING: With a setup of ownCloud 10.x.x + oauth2-app older than v0.5.3 this bugfix is a breaking change. There was a bug in the oauth2-app that required to add the `clientSecret` in the `auth` section of the `config.json` file (although code flow with PKCE doesn't need it). To mitigate this, please add the `clientSecret` for your `clientId` to the `config.json` file. If the oauth2-app v0.5.3 or newer is used that's not needed. https://github.com/owncloud/web/issues/7030 https://github.com/owncloud/web/pull/7072
owncloud/web/changelog/5.7.0_2022-09-09/bugfix-token-renewal/0
{ "file_path": "owncloud/web/changelog/5.7.0_2022-09-09/bugfix-token-renewal", "repo_id": "owncloud", "token_count": 280 }
629
Enhancement: Adjust spacing of the files list options menu We've adjusted the spacing of the files list options menu to visually match with the other menus. https://github.com/owncloud/web/pull/7570 https://github.com/owncloud/web/issues/7541
owncloud/web/changelog/5.7.0_2022-09-09/enhancement-files-list-options-menu-spacing/0
{ "file_path": "owncloud/web/changelog/5.7.0_2022-09-09/enhancement-files-list-options-menu-spacing", "repo_id": "owncloud", "token_count": 67 }
630
Enhancement: Use fixed width for the right sidebar We've set a fixed width of 440px to the right sidebar to have better control of its styling and alignment. https://github.com/owncloud/web/pull/7371 https://github.com/owncloud/web/pull/7384
owncloud/web/changelog/5.7.0_2022-09-09/enhancement-right-sidebar-fixed-width/0
{ "file_path": "owncloud/web/changelog/5.7.0_2022-09-09/enhancement-right-sidebar-fixed-width", "repo_id": "owncloud", "token_count": 70 }
631
Bugfix: "Copy Quicklink"-translations We've fixed a bug where the translation for the "Copy Quicklink"-notification was not working. https://github.com/owncloud/web/pull/7731 https://github.com/owncloud/web/issues/7720
owncloud/web/changelog/6.0.0_2022-11-29/bugfix-copy-quicklink-translations/0
{ "file_path": "owncloud/web/changelog/6.0.0_2022-11-29/bugfix-copy-quicklink-translations", "repo_id": "owncloud", "token_count": 67 }
632
Bugfix: Missing password form on public drop page We've fixed a bug where the password form on a public drop page would not show after setting a required password. https://github.com/owncloud/web/pull/8007 https://github.com/owncloud/web/issues/7670
owncloud/web/changelog/6.0.0_2022-11-29/bugfix-missing-public-password-form/0
{ "file_path": "owncloud/web/changelog/6.0.0_2022-11-29/bugfix-missing-public-password-form", "repo_id": "owncloud", "token_count": 69 }
633
Bugfix: Share permissions for re-shares We've fixed a bug where the selectable roles on a re-share could exceed the parent share's permissions in certain scenarios. https://github.com/owncloud/web/issues/7657 https://github.com/owncloud/web/pull/7844
owncloud/web/changelog/6.0.0_2022-11-29/bugfix-share-permissions-for-reshares/0
{ "file_path": "owncloud/web/changelog/6.0.0_2022-11-29/bugfix-share-permissions-for-reshares", "repo_id": "owncloud", "token_count": 72 }
634
Change: Remove mediaSource and v-image-source We have removed the deprecated `mediaSource` helper function and the `v-image-source` directive. BREAKING CHANGE for developers: `mediaSource` and `v-image-source` are not available anymore, `loadPreview` should be used once web-pkg is published. https://github.com/owncloud/web/pull/7935 https://github.com/owncloud/web/issues/7338 https://github.com/owncloud/web/pull/7072 https://github.com/owncloud/web/pull/7350
owncloud/web/changelog/6.0.0_2022-11-29/change-removed-media-source/0
{ "file_path": "owncloud/web/changelog/6.0.0_2022-11-29/change-removed-media-source", "repo_id": "owncloud", "token_count": 141 }
635
Enhancement: Make keybindings global We've made keybindings global and introduced a data-attribute to mark elements that need custom keybindings https://github.com/owncloud/web/pull/7569 https://github.com/owncloud/web/pull/7648 https://github.com/owncloud/web/pull/7735
owncloud/web/changelog/6.0.0_2022-11-29/enhancement-make-keybindings-global/0
{ "file_path": "owncloud/web/changelog/6.0.0_2022-11-29/enhancement-make-keybindings-global", "repo_id": "owncloud", "token_count": 82 }
636
Bugfix: Copy link to clipboard text We've fixed an issue that caused the link message to display the wrong text https://github.com/owncloud/web/pull/8756 https://github.com/owncloud/web/issues/8725
owncloud/web/changelog/7.0.0_2023-06-02/bugfix-copy-clipboard-text/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-copy-clipboard-text", "repo_id": "owncloud", "token_count": 59 }
637
Bugfix: Loading additional user data Loading additional user data in the admin settings when opening the sidebar via select-toggle has been fixed. https://github.com/owncloud/web/pull/8276 https://github.com/owncloud/web/issues/8275
owncloud/web/changelog/7.0.0_2023-06-02/bugfix-loading-additional-user-data/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-loading-additional-user-data", "repo_id": "owncloud", "token_count": 63 }
638
Bugfix: Preview app mime type detection A bug where the preview app would not detect all supported mime types has been fixed (e.g. `image/x-ms-bmp`). https://github.com/owncloud/web/issues/9050 https://github.com/owncloud/web/pull/9092
owncloud/web/changelog/7.0.0_2023-06-02/bugfix-preview-app-mimetypes/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-preview-app-mimetypes", "repo_id": "owncloud", "token_count": 78 }
639
Bugfix: Sidebar header after deleting resource The sidebar header will now be removed correctly when you delete the currently selected resource. https://github.com/owncloud/web/issues/8880 https://github.com/owncloud/web/pull/8886
owncloud/web/changelog/7.0.0_2023-06-02/bugfix-sidebar-header-after-deleting-resource/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/bugfix-sidebar-header-after-deleting-resource", "repo_id": "owncloud", "token_count": 61 }
640
Change: Update Vue to v3.2 Vue has been updated to v3.2. More detailed information can be found in the referenced issues and PRs down below. BREAKING CHANGE for developers: The `vue/composition-api` plugin is not available anymore as the composition-api now comes with Vue. https://github.com/owncloud/web/issues/7948 https://github.com/owncloud/web/issues/5269 https://github.com/owncloud/web/issues/8283 https://github.com/owncloud/web/issues/8307 https://github.com/owncloud/web/issues/8295 https://github.com/owncloud/web/pull/8128 https://github.com/owncloud/web/pull/7877 https://github.com/owncloud/web/pull/8207 https://github.com/owncloud/web/pull/8201 https://github.com/owncloud/web/pull/8202 https://github.com/owncloud/web/pull/8198 https://github.com/owncloud/web/pull/8213 https://github.com/owncloud/web/pull/8214 https://github.com/owncloud/web/pull/8221 https://github.com/owncloud/web/pull/8256 https://github.com/owncloud/web/pull/8257 https://github.com/owncloud/web/pull/8258 https://github.com/owncloud/web/pull/8282 https://github.com/owncloud/web/pull/8289 https://github.com/owncloud/web/pull/8287 https://github.com/owncloud/web/pull/8285 https://github.com/owncloud/web/pull/8288 https://github.com/owncloud/web/pull/8308 https://github.com/owncloud/web/pull/8311 https://github.com/owncloud/web/pull/8567
owncloud/web/changelog/7.0.0_2023-06-02/change-update-vue/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/change-update-vue", "repo_id": "owncloud", "token_count": 476 }
641
Enhancement: Admin settings users section uses graph api for role assignments We've switched over to utilizing user role assignments data from the graph api instead of the custom settings api. Especially for the list view this leads to improved performance. https://github.com/owncloud/web/pull/8261 https://github.com/owncloud/web/pull/8330 https://github.com/owncloud/web/pull/8418
owncloud/web/changelog/7.0.0_2023-06-02/enhancement-admin-settings-users-role-graph-api-usage/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-admin-settings-users-role-graph-api-usage", "repo_id": "owncloud", "token_count": 99 }
642
Enhancement: Enable rename groups Groups can now be renamed via the admin-settings. https://github.com/owncloud/web/pull/8715 https://github.com/owncloud/web/issues/8714
owncloud/web/changelog/7.0.0_2023-06-02/enhancement-enable-rename-groups/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-enable-rename-groups", "repo_id": "owncloud", "token_count": 55 }
643
Enhancement: Rework notification bell We're now showing the notification bell based on whether the server supports notifications. Previously it was hidden when there were no notifications. We've added a badge that displays the amount of new notifications. https://github.com/owncloud/web/pull/8450 https://github.com/owncloud/web/pull/8454 https://github.com/owncloud/web/issues/8452
owncloud/web/changelog/7.0.0_2023-06-02/enhancement-notification-bell/0
{ "file_path": "owncloud/web/changelog/7.0.0_2023-06-02/enhancement-notification-bell", "repo_id": "owncloud", "token_count": 99 }
644