From 6ef1da68e078edd3805aa4028e5f9eec78b959af Mon Sep 17 00:00:00 2001 From: Ashil <77285023+ashilkn@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:52:03 +0530 Subject: [PATCH 1/7] [photos][mobile] Performance improvement (#1080) ## Description Stack has `clipBehaviour = Clip.hardEdge` by default. This is necessary if content inside the stack is overflowing it's boundary and it has to be clipped. Clipping is expensive so it's worth removing it when it makes sense. In this case of `GalleryFileWidget`, content doesn't overflow the Stack's boundary so the clip operation can be removed by setting `clipBehaviour = Clip.none`. --- mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart b/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart index c6b89de0b..5f1ce7cbf 100644 --- a/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart +++ b/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart @@ -68,6 +68,7 @@ class GalleryFileWidget extends StatelessWidget { : _onLongPressNoSelectionLimit(context, file); }, child: Stack( + clipBehavior: Clip.none, children: [ ClipRRect( borderRadius: BorderRadius.circular(1), From 5db0da9aaf7de7fcb9b3a519c677c5c97a1b2238 Mon Sep 17 00:00:00 2001 From: Crowdin Bot Date: Wed, 13 Mar 2024 02:03:48 +0000 Subject: [PATCH 2/7] New Crowdin translations by GitHub Action --- auth/lib/l10n/arb/app_bg.arb | 1 + auth/lib/l10n/arb/app_de.arb | 13 ++++++++++++- auth/lib/l10n/arb/app_ja.arb | 13 ++++++++++++- auth/lib/l10n/arb/app_pt.arb | 13 ++++++++++++- auth/lib/l10n/arb/app_sv.arb | 14 +++++++++++++- auth/lib/l10n/arb/app_zh.arb | 9 ++++++++- 6 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 auth/lib/l10n/arb/app_bg.arb diff --git a/auth/lib/l10n/arb/app_bg.arb b/auth/lib/l10n/arb/app_bg.arb new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/auth/lib/l10n/arb/app_bg.arb @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/auth/lib/l10n/arb/app_de.arb b/auth/lib/l10n/arb/app_de.arb index 6f9382540..a05c7ca0d 100644 --- a/auth/lib/l10n/arb/app_de.arb +++ b/auth/lib/l10n/arb/app_de.arb @@ -144,6 +144,7 @@ "enterCodeHint": "Geben Sie den 6-stelligen Code \naus Ihrer Authentifikator-App ein.", "lostDeviceTitle": "Gerät verloren?", "twoFactorAuthTitle": "Zwei-Faktor-Authentifizierung", + "passkeyAuthTitle": "Passkey Authentifizierung", "recoverAccount": "Konto wiederherstellen", "enterRecoveryKeyHint": "Geben Sie Ihren Wiederherstellungsschlüssel ein", "recover": "Wiederherstellen", @@ -404,5 +405,15 @@ "signOutOtherDevices": "Andere Geräte abmelden", "doNotSignOut": "Nicht abmelden", "hearUsWhereTitle": "Wie hast du von Ente erfahren? (optional)", - "hearUsExplanation": "Wir tracken keine App-Installationen. Es würde uns jedoch helfen, wenn du uns mitteilst, wie du von uns erfahren hast!" + "hearUsExplanation": "Wir tracken keine App-Installationen. Es würde uns jedoch helfen, wenn du uns mitteilst, wie du von uns erfahren hast!", + "waitingForBrowserRequest": "Warten auf Browseranfrage...", + "launchPasskeyUrlAgain": "Passwort-URL erneut starten", + "passkey": "Passkey", + "developerSettingsWarning": "Sind Sie sicher, dass Sie die Entwicklereinstellungen ändern möchten?", + "developerSettings": "Entwicklereinstellungen", + "serverEndpoint": "Server Endpunkt", + "invalidEndpoint": "Ungültiger Endpunkt", + "invalidEndpointMessage": "Der eingegebene Endpunkt ist ungültig. Bitte geben Sie einen gültigen Endpunkt ein und versuchen Sie es erneut.", + "endpointUpdatedMessage": "Endpunkt erfolgreich aktualisiert", + "customEndpoint": "Mit {endpoint} verbunden" } \ No newline at end of file diff --git a/auth/lib/l10n/arb/app_ja.arb b/auth/lib/l10n/arb/app_ja.arb index 104da4a22..ed1786f71 100644 --- a/auth/lib/l10n/arb/app_ja.arb +++ b/auth/lib/l10n/arb/app_ja.arb @@ -144,6 +144,7 @@ "enterCodeHint": "認証アプリに表示された 6 桁のコードを入力してください", "lostDeviceTitle": "デバイスを紛失しましたか?", "twoFactorAuthTitle": "2 要素認証", + "passkeyAuthTitle": "パスキー認証", "recoverAccount": "アカウントを回復", "enterRecoveryKeyHint": "回復キーを入力", "recover": "回復", @@ -404,5 +405,15 @@ "signOutOtherDevices": "他のデバイスからサインアウトする", "doNotSignOut": "サインアウトしない", "hearUsWhereTitle": "Ente についてどのようにお聞きになりましたか?(任意)", - "hearUsExplanation": "私たちはアプリのインストールを追跡していません。私たちをお知りになった場所を教えてください!" + "hearUsExplanation": "私たちはアプリのインストールを追跡していません。私たちをお知りになった場所を教えてください!", + "waitingForBrowserRequest": "ブラウザのリクエストを待っています...", + "launchPasskeyUrlAgain": "パスキーのURLを再度起動する", + "passkey": "パスキー", + "developerSettingsWarning": "開発者向け設定を変更してもよろしいですか?", + "developerSettings": "開発者向け設定", + "serverEndpoint": "サーバーエンドポイント", + "invalidEndpoint": "無効なエンドポイントです", + "invalidEndpointMessage": "入力されたエンドポイントは無効です。有効なエンドポイントを入力して再試行してください。", + "endpointUpdatedMessage": "エンドポイントの更新に成功しました", + "customEndpoint": "{endpoint} に接続しました" } \ No newline at end of file diff --git a/auth/lib/l10n/arb/app_pt.arb b/auth/lib/l10n/arb/app_pt.arb index a3f5262e7..10c34ab29 100644 --- a/auth/lib/l10n/arb/app_pt.arb +++ b/auth/lib/l10n/arb/app_pt.arb @@ -144,6 +144,7 @@ "enterCodeHint": "Digite o código de 6 dígitos de\nseu aplicativo autenticador", "lostDeviceTitle": "Perdeu seu dispositivo?", "twoFactorAuthTitle": "Autenticação de dois fatores", + "passkeyAuthTitle": "Autenticação via Chave de acesso", "recoverAccount": "Recuperar conta", "enterRecoveryKeyHint": "Digite sua chave de recuperação", "recover": "Recuperar", @@ -404,5 +405,15 @@ "signOutOtherDevices": "Terminar sessão em outros dispositivos", "doNotSignOut": "Não encerrar sessão", "hearUsWhereTitle": "Como você ouviu sobre o Ente? (opcional)", - "hearUsExplanation": "Não rastreamos instalações do aplicativo. Seria útil se você nos contasse onde nos encontrou!" + "hearUsExplanation": "Não rastreamos instalações do aplicativo. Seria útil se você nos contasse onde nos encontrou!", + "waitingForBrowserRequest": "Aguardando solicitação do navegador...", + "launchPasskeyUrlAgain": "Iniciar a URL de chave de acesso novamente", + "passkey": "Chave de acesso", + "developerSettingsWarning": "Tem certeza de que deseja modificar as configurações de Desenvolvedor?", + "developerSettings": "Configurações de desenvolvedor", + "serverEndpoint": "Endpoint do servidor", + "invalidEndpoint": "Endpoint inválido", + "invalidEndpointMessage": "Desculpe, o endpoint que você inseriu é inválido. Por favor, insira um endpoint válido e tente novamente.", + "endpointUpdatedMessage": "Endpoint atualizado com sucesso", + "customEndpoint": "Conectado a {endpoint}" } \ No newline at end of file diff --git a/auth/lib/l10n/arb/app_sv.arb b/auth/lib/l10n/arb/app_sv.arb index faaff39cb..d99ed5f5f 100644 --- a/auth/lib/l10n/arb/app_sv.arb +++ b/auth/lib/l10n/arb/app_sv.arb @@ -131,6 +131,16 @@ "about": "Om", "terms": "Villkor", "warning": "Varning", + "importSuccessDesc": "Du har importerat {count} koder!", + "@importSuccessDesc": { + "placeholders": { + "count": { + "description": "The number of codes imported", + "type": "int", + "example": "1" + } + } + }, "pendingSyncs": "Varning", "activeSessions": "Aktiva sessioner", "enterPassword": "Ange lösenord", @@ -143,5 +153,7 @@ "iOSOkButton": "OK", "@iOSOkButton": { "description": "Message showed on a button that the user can click to leave the current dialog. It is used on iOS side. Maximum 30 characters." - } + }, + "noInternetConnection": "Ingen internetanslutning", + "pleaseCheckYourInternetConnectionAndTryAgain": "Kontrollera din internetanslutning och försök igen." } \ No newline at end of file diff --git a/auth/lib/l10n/arb/app_zh.arb b/auth/lib/l10n/arb/app_zh.arb index 6d30306b0..b6d4ed244 100644 --- a/auth/lib/l10n/arb/app_zh.arb +++ b/auth/lib/l10n/arb/app_zh.arb @@ -408,5 +408,12 @@ "hearUsExplanation": "我们不跟踪应用程序安装情况。如果您告诉我们您是在哪里找到我们的,将会有所帮助!", "waitingForBrowserRequest": "正在等待浏览器请求...", "launchPasskeyUrlAgain": "再次启动 通行密钥 URL", - "passkey": "通行密钥" + "passkey": "通行密钥", + "developerSettingsWarning": "您确定要修改开发者设置吗?", + "developerSettings": "开发者设置", + "serverEndpoint": "服务器端点", + "invalidEndpoint": "端点无效", + "invalidEndpointMessage": "抱歉,您输入的端点无效。请输入有效的端点,然后重试。", + "endpointUpdatedMessage": "端点更新成功", + "customEndpoint": "已连接至 {endpoint}" } \ No newline at end of file From 83aa3db795a85bb181cb8d54454eec00db8b362f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:55:47 +0530 Subject: [PATCH 3/7] [mobile] New translations (#740) New translations from [Crowdin](https://crowdin.com/project/ente-photos-app) Co-authored-by: Crowdin Bot --- .../metadata/android/pt/full_description.txt | 2 +- .../metadata/android/zh/full_description.txt | 10 ++++---- .../fastlane/metadata/ios/pt/description.txt | 2 +- .../playstore/pt/full_description.txt | 2 +- mobile/lib/l10n/intl_de.arb | 25 ++++++++++++++++--- mobile/lib/l10n/intl_pt.arb | 9 ++++--- mobile/lib/l10n/intl_zh.arb | 9 ++++--- 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/mobile/fastlane/metadata/android/pt/full_description.txt b/mobile/fastlane/metadata/android/pt/full_description.txt index 6719156c6..2bd26df1e 100644 --- a/mobile/fastlane/metadata/android/pt/full_description.txt +++ b/mobile/fastlane/metadata/android/pt/full_description.txt @@ -1,6 +1,6 @@ ente é um aplicativo simples para fazer backup e compartilhar suas fotos e vídeos. -Se você está procurando uma alternativa ao Google Photos com foco em privacidade, veio ao lugar certo. Com ente, eles são armazenados com criptografia de ponta a ponta (e2ee). Isso significa que só você pode vê-los. +Se você está procurando uma alternativa ao Google Fotos com foco em privacidade, você veio ao lugar certo. Com ente, eles são armazenados com criptografia de ponta a ponta (e2ee). Isso significa que só você pode vê-los. Temos aplicativos de código aberto em todas as plataformas, Android, iOS, web e desktop, e suas fotos irão sincronizar perfeitamente entre todas elas de forma criptografada (e2ee). diff --git a/mobile/fastlane/metadata/android/zh/full_description.txt b/mobile/fastlane/metadata/android/zh/full_description.txt index 6eddd122d..301c5bd35 100644 --- a/mobile/fastlane/metadata/android/zh/full_description.txt +++ b/mobile/fastlane/metadata/android/zh/full_description.txt @@ -1,12 +1,12 @@ ente 是一个简单的应用程序来备份和分享您的照片和视频。 -如果你一直在寻找一个隐私友好的Google Photos替代品,那么你就来对地方了。 使用 Ente,它们以端到端加密 (e2ee) 的方式存储。 这意味着只有您可以查看它们。 +如果你一直在寻找一个隐私友好的Google Photos替代品,那么你就来对地方了。 使用 Ente,它们以端到端加密 (e2ee) 的方式存储。 这意味着只有您可以查看它们。 使用 Ente,它们以端到端加密 (e2ee) 的方式存储。 这意味着只有您可以查看它们。 我们在Android、iOS、web 和桌面上有开源应用, 和您的照片将以端到端加密方式 (e2ee) 无缝同步。 -ente也使分享相册给自己的爱人、亲人变得轻而易举,即使他们可能并不使用ente。 您可以分享可公开查看的链接,使他们可以查看您的相册,并通过添加照片来协作而不需要注册账户或下载app。 +ente也使分享相册给自己的爱人、亲人变得轻而易举,即使他们可能并不使用ente。 您可以分享可公开查看的链接,使他们可以查看您的相册,并通过添加照片来协作而不需要注册账户或下载app。 权限 -您的加密数据已复制到三个不同的地点,包括巴黎的一个安全屋。 我们认真对待子孙后代,并确保您的回忆比您长寿。 +您的加密数据已复制到三个不同的地点,包括巴黎的一个安全屋。 我们认真对待子孙后代,并确保您的回忆比您长寿。 我们认真对待子孙后代,并确保您的回忆比您长寿。 我们来这里是为了打造有史以来最安全的照片应用,来和我们一起前行! @@ -30,7 +30,7 @@ ente也使分享相册给自己的爱人、亲人变得轻而易举,即使他 ente需要特定权限以执行作为图像存储提供商的职责,相关内容可以在此链接查阅:https://github.com/ente-io/photos-app/blob/f-droid/android/permissions.md 价格 -我们不会提供永久免费计划,因为我们必须保持可持续性,经受住时间的考验。 相反,我们向您提供了价格实惠、可自由分享的订阅计划。 您可以在 ente.io 找到更多信息。 +我们不会提供永久免费计划,因为我们必须保持可持续性,经受住时间的考验。 相反,我们向您提供了价格实惠、可自由分享的订阅计划。 您可以在 ente.io 找到更多信息。 相反,我们向您提供了价格实惠、可自由分享的订阅计划。 您可以在 ente.io 找到更多信息。 支持 -我们对提供真人支持感到自豪。 如果您是我们的付费客户,您可以联系 team@ente.io 并在24小时内收到来自我们团队的回复。 +我们对提供真人支持感到自豪。 我们对提供真人支持感到自豪。 如果您是我们的付费客户,您可以联系 team@ente.io 并在24小时内收到来自我们团队的回复。 diff --git a/mobile/fastlane/metadata/ios/pt/description.txt b/mobile/fastlane/metadata/ios/pt/description.txt index c2c44ed89..3d948a2b2 100644 --- a/mobile/fastlane/metadata/ios/pt/description.txt +++ b/mobile/fastlane/metadata/ios/pt/description.txt @@ -1,6 +1,6 @@ Ente é um aplicativo simples para fazer backup e compartilhar suas fotos e vídeos. -Se você esteve procurando uma alternativa amigável à privacidade para preservar suas memórias, você veio ao lugar certo. Com ente, eles são armazenados com criptografia de ponta a ponta (e2ee). Isso significa que só você pode vê-los. +Se você esteve procurando uma alternativa amigável à privacidade para preservar suas memórias, você veio ao lugar certo. Com Ente, elas são armazenadas com criptografia de ponta a ponta (e2ee). Isso significa que só você pode vê-las. Temos aplicativos de código aberto em Android, iOS, web e desktop, e suas fotos irão sincronizar perfeitamente entre todas elas de forma criptografada (e2ee). diff --git a/mobile/fastlane/metadata/playstore/pt/full_description.txt b/mobile/fastlane/metadata/playstore/pt/full_description.txt index 18fa7675f..fc02bad10 100644 --- a/mobile/fastlane/metadata/playstore/pt/full_description.txt +++ b/mobile/fastlane/metadata/playstore/pt/full_description.txt @@ -1,6 +1,6 @@ Ente é um aplicativo simples para fazer backup e compartilhar suas fotos e vídeos. -Se você esteve procurando uma alternativa amigável à privacidade para preservar suas memórias, você veio ao lugar certo. Com ente, eles são armazenados com criptografados de ponta a ponta (e2ee). Isso significa que só você pode vê-los. +Se você esteve procurando uma alternativa amigável à privacidade para preservar suas memórias, você veio ao lugar certo. Com Ente, elas são armazenadas com criptografia de ponta a ponta (e2ee). Isso significa que só você pode vê-las. Temos aplicativos de código aberto em todas as plataformas, Android, iOS, web e desktop, e suas fotos irão sincronizar perfeitamente entre todas elas de forma criptografada (e2ee). diff --git a/mobile/lib/l10n/intl_de.arb b/mobile/lib/l10n/intl_de.arb index 117cd799e..50a4a1b21 100644 --- a/mobile/lib/l10n/intl_de.arb +++ b/mobile/lib/l10n/intl_de.arb @@ -406,6 +406,15 @@ }, "photoGridSize": "Fotorastergröße", "manageDeviceStorage": "Gerätespeicher verwalten", + "machineLearning": "Maschinelles Lernen", + "magicSearch": "Magische Suche", + "magicSearchDescription": "Bitte beachten Sie, dass dies mehr Bandbreite nutzt und zu einem höheren Akkuverbrauch führt, bis alle Elemente indiziert sind.", + "loadingModel": "Lade Modelle herunter...", + "waitingForWifi": "Warte auf WLAN...", + "status": "Status", + "indexedItems": "Indizierte Elemente", + "pendingItems": "Ausstehende Elemente", + "clearIndexes": "Indexe löschen", "selectFoldersForBackup": "Ordner für Sicherung auswählen", "selectedFoldersWillBeEncryptedAndBackedUp": "Ausgewählte Ordner werden verschlüsselt und gesichert", "unselectAll": "Alle demarkieren", @@ -1178,7 +1187,17 @@ "changeLocationOfSelectedItems": "Standort der gewählten Elemente ändern?", "editsToLocationWillOnlyBeSeenWithinEnte": "Änderungen des Standorts werden nur in ente sichtbar sein", "cleanUncategorized": "Unkategorisiert leeren", - "joinDiscord": "Join Discord", - "locations": "Locations", - "descriptions": "Descriptions" + "cleanUncategorizedDescription": "Entferne alle Dateien von \"Unkategorisiert\" die in anderen Alben vorhanden sind", + "waitingForVerification": "Warte auf Bestätigung...", + "passkey": "Passkey", + "passkeyAuthTitle": "Passkey-Verifizierung", + "verifyPasskey": "Passkey verifizieren", + "playOnTv": "Album auf dem Fernseher wiedergeben", + "pair": "Koppeln", + "deviceNotFound": "Gerät nicht gefunden", + "castInstruction": "Besuche cast.ente.io auf dem Gerät, das du verbinden möchtest.\n\nGib den unten angegebenen Code ein, um das Album auf deinem Fernseher abzuspielen.", + "deviceCodeHint": "Code eingeben", + "joinDiscord": "Discord beitreten", + "locations": "Orte", + "descriptions": "Beschreibungen" } \ No newline at end of file diff --git a/mobile/lib/l10n/intl_pt.arb b/mobile/lib/l10n/intl_pt.arb index ccbe1b69d..bf0e53409 100644 --- a/mobile/lib/l10n/intl_pt.arb +++ b/mobile/lib/l10n/intl_pt.arb @@ -1187,16 +1187,17 @@ "changeLocationOfSelectedItems": "Alterar o local dos itens selecionados?", "editsToLocationWillOnlyBeSeenWithinEnte": "Edições para local só serão vistas dentro do Ente", "cleanUncategorized": "Limpar Sem Categoria", - "waitingForBrowserRequest": "Aguardando solicitação do navegador...", - "launchPasskeyUrlAgain": "Iniciar a URL de chave de acesso novamente", + "cleanUncategorizedDescription": "Remover todos os arquivos de Não Categorizados que estão presentes em outros álbuns", + "waitingForVerification": "Esperando por verificação...", "passkey": "Chave de acesso", "passkeyAuthTitle": "Autenticação via Chave de acesso", + "verifyPasskey": "Verificar chave de acesso", "playOnTv": "Reproduzir álbum na TV", "pair": "Parear", "deviceNotFound": "Dispositivo não encontrado", "castInstruction": "Visite cast.ente.io no dispositivo que você deseja parear.\n\ndigite o código abaixo para reproduzir o álbum em sua TV.", "deviceCodeHint": "Insira o código", "joinDiscord": "Junte-se ao Discord", - "locations": "Locations", - "descriptions": "Descriptions" + "locations": "Locais", + "descriptions": "Descrições" } \ No newline at end of file diff --git a/mobile/lib/l10n/intl_zh.arb b/mobile/lib/l10n/intl_zh.arb index 7519a9aa4..4e9e9e4eb 100644 --- a/mobile/lib/l10n/intl_zh.arb +++ b/mobile/lib/l10n/intl_zh.arb @@ -1187,16 +1187,17 @@ "changeLocationOfSelectedItems": "确定要更改所选项目的位置吗?", "editsToLocationWillOnlyBeSeenWithinEnte": "对位置的编辑只能在 Ente 内看到", "cleanUncategorized": "清除未分类的", - "waitingForBrowserRequest": "正在等待浏览器请求...", - "launchPasskeyUrlAgain": "再次启动 通行密钥 URL", + "cleanUncategorizedDescription": "从“未分类”中删除其他相册中存在的所有文件", + "waitingForVerification": "等待验证...", "passkey": "通行密钥", "passkeyAuthTitle": "通行密钥认证", + "verifyPasskey": "验证通行密钥", "playOnTv": "在电视上播放相册", "pair": "配对", "deviceNotFound": "未发现设备", "castInstruction": "在您要配对的设备上访问 cast.ente.io。\n输入下面的代码即可在电视上播放相册。", "deviceCodeHint": "输入代码", "joinDiscord": "加入 Discord", - "locations": "Locations", - "descriptions": "Descriptions" + "locations": "位置", + "descriptions": "描述" } \ No newline at end of file From 2faef37f4b211b8c3faa86343301f93fd9a01f96 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 13 Mar 2024 14:25:07 +0530 Subject: [PATCH 4/7] Fix the upload tests The current approach wasn't working. Not sure what caused it to stop working, but anyway that was an hacky import, as evidenced by the ungainly warning webpack would print on `yarn dev`. So instead of taking the path, we just take the JSON contents directly, sidestepping all that. **Tested by** Rerunning the upload tests --- web/apps/photos/.env.development | 11 ++++++++--- web/apps/photos/tests/upload.test.ts | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/web/apps/photos/.env.development b/web/apps/photos/.env.development index 038f0237a..548e5bbfb 100644 --- a/web/apps/photos/.env.development +++ b/web/apps/photos/.env.development @@ -68,7 +68,12 @@ # # NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT = http://localhost:3003 -# The path of the JSON file which contains the expected results of our -# integration tests. See `upload.test.ts` for more details. +# The JSON which describes the expected results of our integration tests. See +# `upload.test.ts` for more details of the expected format. # -# NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON_PATH = /path/to/dataset/expected.json +# This is perhaps easier to specify as an environment variable, since then we +# can directly read from the source file when running `yarn dev`. For example, +# +# NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON=`cat path/to/expected.json` yarn dev +# +# NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON = {} diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.ts index dcd16db3c..6e58cf0c2 100644 --- a/web/apps/photos/tests/upload.test.ts +++ b/web/apps/photos/tests/upload.test.ts @@ -100,13 +100,13 @@ const FILE_NAME_TO_JSON_NAME = [ ]; export async function testUpload() { - const jsonPath = process.env.NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON_PATH; - if (!jsonPath) { + const jsonString = process.env.NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON; + if (!jsonString) { throw Error( - "Please specify the NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON_PATH to run the upload tests", + "Please specify the NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON to run the upload tests", ); } - const expectedState = await import(jsonPath); + const expectedState = JSON.parse(jsonString); if (!expectedState) { throw Error("upload test failed expectedState missing"); } From df316463ef9b8289b0e775073c73c011464d2d44 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Wed, 13 Mar 2024 14:57:19 +0530 Subject: [PATCH 5/7] Ignore linter on the f-droid branch --- .github/workflows/mobile-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.yml index 7b5e5fbed..cbbbbcfbb 100644 --- a/.github/workflows/mobile-lint.yml +++ b/.github/workflows/mobile-lint.yml @@ -3,7 +3,7 @@ name: "Lint (mobile)" on: # Run on every push to a branch other than main that changes mobile/ push: - branches-ignore: [main] + branches-ignore: [main, f-droid] paths: - "mobile/**" - ".github/workflows/mobile-lint.yml" From 77276d8d6cac4a4c615454a47abef9dbadae4812 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Wed, 13 Mar 2024 17:31:38 +0530 Subject: [PATCH 6/7] [server] Add admin API to change email address --- server/cmd/museum/main.go | 1 + server/ente/admin.go | 5 +++++ server/pkg/api/admin.go | 19 +++++++++++++++++++ server/pkg/controller/user/userauth.go | 9 +++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.go index 9403efaa5..14ceb3e3b 100644 --- a/server/cmd/museum/main.go +++ b/server/cmd/museum/main.go @@ -620,6 +620,7 @@ func main() { adminAPI.POST("/user/disable-2fa", adminHandler.DisableTwoFactor) adminAPI.POST("/user/disable-passkeys", adminHandler.RemovePasskeys) adminAPI.POST("/user/close-family", adminHandler.CloseFamily) + adminAPI.PUT("/user/change-email", adminHandler.ChangeEmail) adminAPI.DELETE("/user/delete", adminHandler.DeleteUser) adminAPI.POST("/user/recover", adminHandler.RecoverAccount) adminAPI.GET("/email-hash", adminHandler.GetEmailHash) diff --git a/server/ente/admin.go b/server/ente/admin.go index 66ad27741..c56e48e5b 100644 --- a/server/ente/admin.go +++ b/server/ente/admin.go @@ -46,6 +46,11 @@ type UpdateSubscriptionRequest struct { Attributes SubscriptionAttributes `json:"attributes"` } +type ChangeEmailRequest struct { + UserID int64 `json:"userID" binding:"required"` + Email string `json:"email" binding:"required"` +} + type AddOnAction string const ( diff --git a/server/pkg/api/admin.go b/server/pkg/api/admin.go index 90c9fd3e6..b153e19bb 100644 --- a/server/pkg/api/admin.go +++ b/server/pkg/api/admin.go @@ -306,6 +306,25 @@ func (h *AdminHandler) UpdateSubscription(c *gin.Context) { c.JSON(http.StatusOK, gin.H{}) } +func (h *AdminHandler) ChangeEmail(c *gin.Context) { + var r ente.ChangeEmailRequest + if err := c.ShouldBindJSON(&r); err != nil { + handler.Error(c, stacktrace.Propagate(ente.ErrBadRequest, "Bad request")) + return + } + adminID := auth.GetUserID(c.Request.Header) + go h.DiscordController.NotifyAdminAction( + fmt.Sprintf("Admin (%d) updating email for user: %d", adminID, r.UserID)) + err := h.UserController.UpdateEmail(c, r.UserID, r.Email) + if err != nil { + logrus.WithError(err).Error("Failed to update email") + handler.Error(c, stacktrace.Propagate(err, "")) + return + } + logrus.Info("Updated email") + c.JSON(http.StatusOK, gin.H{}) +} + func (h *AdminHandler) ReQueueItem(c *gin.Context) { var r ente.ReQueueItemRequest if err := c.ShouldBindJSON(&r); err != nil { diff --git a/server/pkg/controller/user/userauth.go b/server/pkg/controller/user/userauth.go index bf092cb14..bbc9942de 100644 --- a/server/pkg/controller/user/userauth.go +++ b/server/pkg/controller/user/userauth.go @@ -197,7 +197,13 @@ func (c *UserController) ChangeEmail(ctx *gin.Context, request ente.EmailVerific if err != nil { return stacktrace.Propagate(err, "") } - _, err = c.UserRepo.GetUserIDWithEmail(email) + + return c.UpdateEmail(ctx, auth.GetUserID(ctx.Request.Header), email) +} + +// UpdateEmail updates the email address of the user with the provided userID +func (c *UserController) UpdateEmail(ctx *gin.Context, userID int64, email string) error { + _, err := c.UserRepo.GetUserIDWithEmail(email) if err == nil { // email already owned by a user return stacktrace.Propagate(ente.ErrPermissionDenied, "") @@ -206,7 +212,6 @@ func (c *UserController) ChangeEmail(ctx *gin.Context, request ente.EmailVerific // unknown error, rethrow return stacktrace.Propagate(err, "") } - userID := auth.GetUserID(ctx.Request.Header) user, err := c.UserRepo.Get(userID) if err != nil { return stacktrace.Propagate(err, "") From 1cacefa1fdfe2fff6fa4f1e40da5339f95fadf9a Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Wed, 13 Mar 2024 21:56:48 +0530 Subject: [PATCH 7/7] v0.8.71 --- mobile/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index fdf00a1d2..3adcf3ca3 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -12,7 +12,7 @@ description: ente photos application # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.8.70+590 +version: 0.8.71+591 publish_to: none environment: